Jump to content

[SOLVED] Easy One but hard for me


emediastudios

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.