Hello.. Well i try to delete a files using unlink but returns me an error "Permission Denied". i'll try to set the directory to chmod 777 but still the same error. here's my code: <?php //==== del.php ==== $filepath = $fle; if ($_REQUEST['loc']=="newjob") { $linkval="newjob.php"; } if (! unlink ($filepath)) { echo ("Couldn't delete file"); } else { header("Location: $linkval"); } ?> Code (markup): and then for the link delete <A HREF='del.php?fle=$destination$file&loc=newjob'>Delete</A> Code (markup): thanks
If the file is chmoded to 777 you should be able to remove it. Also check that GUID and UID are set to apache Peace,
wow...are you sure you want to have that code out in the wild? I hope that is in a protected area. Bobby
I agree with Chemo. As convenient as that bit of code is, I would stick to deleting files from an ssh client session or from a site management panel, such as webmin, directadmin, cpanel, or . . . In my programs I allow files to be created, erased, modified. But I never allow the choice of files to be defined by a URL string because people could simply edit the URL to erase any file of their choosing.