haris244808 Posted September 17, 2012 Share Posted September 17, 2012 im trying to delete 2 files but the unlink function doesnt delete them any suggestion here is function im using: public function place_delete(){ $cityPlace_UploadDir = $this->cityPlace_Dir . $this->place_main_photo_name; $cityPlace_UploadThumbDir = $this->cityPlace_thumbsDir . $this->place_main_photo_name; if(unlink($cityPlace_UploadDir)){ if(unlink($cityPlace_UploadThumbDir)){ //DELETE some sql values return (mysql_affected_rows() == 1) ? true : false; } else{ return false; } } else{ return false; } } Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/ Share on other sites More sharing options...
requinix Posted September 17, 2012 Share Posted September 17, 2012 Have you done any debugging yet? Printed out values and made sure they're right? Made sure your php.ini has error_reporting = -1 display_errors = on and looked for error messages? Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378520 Share on other sites More sharing options...
Christian F. Posted September 17, 2012 Share Posted September 17, 2012 Also, please use the tags around your code, as it helps make both your post and your code a lot easier to read. Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378542 Share on other sites More sharing options...
jazzman1 Posted September 17, 2012 Share Posted September 17, 2012 In addition to @requinix, Do you know that you need to call this function somewhere in your script? Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378563 Share on other sites More sharing options...
haris244808 Posted September 17, 2012 Author Share Posted September 17, 2012 Have you done any debugging yet? Printed out values and made sure they're right? Made sure your php.ini has error_reporting = -1 display_errors = on and looked for error messages? here are the configs in php.ini: i debuged and it shows no error. I am using classess. I get a file name and directory to another function and assign them to those values inside unlink() function error_reporting = E_ALL | E_STRICT ; error_reporting ; Default Value: E_ALL & ~E_NOTICE ; Development Value: E_ALL | E_STRICT ; Production Value: E_ALL & ~E_DEPRECATED ; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378564 Share on other sites More sharing options...
haris244808 Posted September 17, 2012 Author Share Posted September 17, 2012 Also, please use the tags around your code, as it helps make both your post and your code a lot easier to read. i cannot edit now... Im Sorry for that mistake Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378565 Share on other sites More sharing options...
haris244808 Posted September 17, 2012 Author Share Posted September 17, 2012 In addition to @requinix, Do you know that you need to call this function somewhere in your script? of course that i call that function to another page Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378567 Share on other sites More sharing options...
haris244808 Posted September 17, 2012 Author Share Posted September 17, 2012 i figured it out... it was not getting the filename corrrectly thnx anyway Link to comment https://forums.phpfreaks.com/topic/268453-unlink-problem/#findComment-1378582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.