Problem with unlink..
Moderator: General Moderators
Problem with unlink..
I've been trying to get this to work for some time and now that my brain is mush I feel it's time to go to the experts. I have a php generated page that displays all of the files from a users directory. Beside the file names is a "Delete" link that SHOULD delete the file it is next to when clicked. However, as soon as the page loads ALL of the files get deleted. What is the best way to go about this?
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany
The link looks like this:
And the script is just this:
I have absolutely no idea how to do this. Obvious from the code I'm sure, but I always try it myself before asking. Thanks for any help.
Code: Select all
<a href="delete.php">Delete</a>Code: Select all
<?php
session_start();
header("Cache-control: private");
unlink($file);
?>