I am trying to add a way for a user to change a status image through the use of PHP. I am not sure where I need to go next with my code. I want the user to be able to make a selection from one page that copies/overwrites another image so that it will automatically appear when a visitor visits the main page. All I need to do is copy one image file renaming and overwriting another. For example: open.jpg or closed.jpg xyz.jpg I am not sure where to define the image to copy/rename/overwrite. I am seeing a lot of helps for FTP issues, but not for doing this. The 3 images are all in the same images folder. Can anyone help me? Is this even possible in PHP?
<?php // define variables and set to empty values $WinterStatusErr = ""; $WinterStatus = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["WinterStatus"])) {$WinterStatusErr = "Status is required";} else {$WinterStatus = test_input($_POST["WinterStatus"]);} } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?>* required selection
"> Set Winter Weather Status:value="Open">Open value="Closed">Closed * <?php echo $WinterStatusErr;?>