Jump to content

unlink Help


lucan

Recommended Posts

Need help with this code. I'm trying to delete images from a folder and table. I can delete the table infomation but i can't delete the image from the folder this is the code i'm using. Where am I going wrong.

 






mysql_connect("localhost", "", "")or die("cannot connect"); 
mysql_select_db("")or die("cannot select DB");

unlink('../loginarea/productimages' . $row['uploadfile']);

mysql_query("DELETE FROM hscatalogue WHERE ID = $_GET[id]") or die (mysql_error());

$result = mysql_query($sql);



echo "Your information has been DELETED!";





Link to comment
https://forums.phpfreaks.com/topic/242018-unlink-help/
Share on other sites

1. Make sure you have the right filename. Should there be a slash after "productimages"?

2. You may need to chmod 0777 the parent directory (loginarea). There might be a smarter solution so could you explain the hosting situation (who hosts the website, whether you have "shell"/SSH access or just FTP, and anything else you think might be relevant)?

Link to comment
https://forums.phpfreaks.com/topic/242018-unlink-help/#findComment-1242869
Share on other sites

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.