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. Link to comment https://forums.phpfreaks.com/topic/73075-solved-easy-one-but-hard-for-me/ Share on other sites More sharing options...
AndyB Posted October 13, 2007 Share Posted October 13, 2007 $myFile = "../images/". $_POST['photo']; unlink($myFile); Link to comment https://forums.phpfreaks.com/topic/73075-solved-easy-one-but-hard-for-me/#findComment-368506 Share on other sites More sharing options...
emediastudios Posted October 13, 2007 Author Share Posted October 13, 2007 Thanks Champ Link to comment https://forums.phpfreaks.com/topic/73075-solved-easy-one-but-hard-for-me/#findComment-368510 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? Link to comment https://forums.phpfreaks.com/topic/73075-solved-easy-one-but-hard-for-me/#findComment-368511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.