lucan Posted July 14, 2011 Share Posted July 14, 2011 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!"; Quote Link to comment https://forums.phpfreaks.com/topic/242018-unlink-help/ Share on other sites More sharing options...
requinix Posted July 14, 2011 Share Posted July 14, 2011 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)? Quote Link to comment https://forums.phpfreaks.com/topic/242018-unlink-help/#findComment-1242869 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.