I have a file called removepics.php which lists all the pictures a user has on my server and gives the options to delete any one (using a form and submit button which calls removepics2.php).
removepics2.php removes the file from the server successfully, and then redirects back to removepics.php so the user can remove another picture (it does this using a form and submit button again).
But when removepics.php is reloaded, the deleted picture is still there. I'm thinking it has something to do with cookies?
I want the deleted picture to not be there. Any help would be greatly appreciated.
Here is my code for removepics2.php:
-------------------------------------------------
<?php
$PicNum = $_POST['picnum'];
$HouseNum = $_POST['housenum'];
$EmailAddress = $_POST['emailaddress'];
unlink('../forms/uploaded_files/'.
$HouseNum.'-'.$PicNum.'.jpg');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"';
echo '"http://www.w3.org/
TR/html4/strict.dtd">';
echo '<html lang="en">';
echo '<form method="post" name="myform" action="removepics.php">';
echo '<input type="hidden" name="emailaddress" value="'.$EmailAddress.'" >';
echo '<input type="hidden" name="housenum" value="'.$HouseNum.'" >';
echo '<input type="submit">';
echo '</form>';
echo '<script>';
echo 'document.myform.submit();';
echo '</script>';
?>
---------------------------------------------------
removepics2.php removes the file from the server successfully, and then redirects back to removepics.php so the user can remove another picture (it does this using a form and submit button again).
But when removepics.php is reloaded, the deleted picture is still there. I'm thinking it has something to do with cookies?
I want the deleted picture to not be there. Any help would be greatly appreciated.
Here is my code for removepics2.php:
-------------------------------------------------
<?php
$PicNum = $_POST['picnum'];
$HouseNum = $_POST['housenum'];
$EmailAddress = $_POST['emailaddress'];
unlink('../forms/uploaded_files/'.
$HouseNum.'-'.$PicNum.'.jpg');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"';
echo '"http://www.w3.org/
TR/html4/strict.dtd">';
echo '<html lang="en">';
echo '<form method="post" name="myform" action="removepics.php">';
echo '<input type="hidden" name="emailaddress" value="'.$EmailAddress.'" >';
echo '<input type="hidden" name="housenum" value="'.$HouseNum.'" >';
echo '<input type="submit">';
echo '</form>';
echo '<script>';
echo 'document.myform.submit();';
echo '</script>';
?>
---------------------------------------------------