Gamerz Posted July 12, 2009 Share Posted July 12, 2009 Hi, I just made a quick code and tested it and it worked... What I'm trying to do is that I want to type a file via a form in the browser, and then delete the typed file using unlink...(only works if file exists) But I want to prevent from itself being deleted...itself as the form and the delete.php as shown below.. Here's the form: <form action="delete.php" method="post"> <input type="text" name="delete"> <input type="submit"> </form> Here's the unlink code (delete.php) <?php $delete = $_POST["delete"]; unlink($delete) or die('Unable to delete the file'); ?> So how do i do that? Link to comment https://forums.phpfreaks.com/topic/165651-php-search-function-and-unlink-prevent-from-deleting-this-file/ Share on other sites More sharing options...
Gamerz Posted July 12, 2009 Author Share Posted July 12, 2009 any ideas? Link to comment https://forums.phpfreaks.com/topic/165651-php-search-function-and-unlink-prevent-from-deleting-this-file/#findComment-873869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.