emediastudios Posted October 13, 2007 Share Posted October 13, 2007 How would i add code to this so that it reads it as ../images/$_POST['photo']; I have $myFile =$_POST['photo']; unlink($myFile); This works if the file is in the directory this file resides but it doesnt, it is is my images folder ../images. Quote Link to comment Share on other sites More sharing options...
AndyB Posted October 13, 2007 Share Posted October 13, 2007 $myFile = "../images/". $_POST['photo']; unlink($myFile); Quote Link to comment Share on other sites More sharing options...
emediastudios Posted October 13, 2007 Author Share Posted October 13, 2007 Thanks Champ Quote Link to comment Share on other sites More sharing options...
emediastudios Posted October 13, 2007 Author Share Posted October 13, 2007 If i had more images that one i could just duplicate the code like $myFile2 = "../images/". $_POST['photo2']; unlink($myFile2); But if i dont have a photo2 i get this error. Warning: unlink(../images/) [function.unlink]: Permission denied in C:\Program Files\Apache Group\Apache2\htdocs\gcproperty\admin\property_delete.php on line 106 Can i use a if empty statement somehow? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.