note 58080 rejected from function.unlink by betz

From: Date: Sun, 23 Oct 2005 19:35:15 +0000
Subject: note 58080 rejected from function.unlink by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-97471@lists.php.net to get a copy of this message
Note Submitter: sidepa at ntlworld dot com ---- Sorry about this guys, but I have looked at EVERY page that has come up in search engines regarding unlink(), but none of them actually explain how the hell you're supposed to use it! Here's my problem..... I have a html/php form that uploads files to a directory, and lists the files in that directory in the form of a hyperlink to the file. Just before the link to the file, I want a delete button that will delete only that file from the directory. What php code do I need to add for the delete function, and what code do I need to add to the a href="NO-IDEA" for the delete button, to call the delete function? Code I'm using to list & link the directory contents........ <?PHP $dir = "download"; $handle = opendir($dir); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<a href=\"NO-IDEA\"><img src=\"images/delete.gif\"></a><a href=\"$dir/$file\" target=\"_blank\">$file</a><br>"; } } closedir($handle); ?> Code above includes backslashes before quotes in the echo, but for some reason they won't show in this post!!! ANY help would be much appreciated. Thanks guys

« previous php.notes (#97471) next »