stefpretty Posted April 7, 2006 Share Posted April 7, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: unlink(photo/15.jpg): No such file or directory in /home/fsuk/public_html/bla/delphoto.php on line 9[/quote] thts the error message am i using the ulin incorrectly? heres the coe of line 9:[code] unlink('photo/'.$_SESSION['photo']);[/code]it also does it when uploading with the upload form as befor eit uploads it deletes the old pic frst so im thinkin its my syntax of unlink..... heres error message [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: unlink(http://fsuk.t1hosting.co.uk/bla/photos/15.jpg): No such file or directory in /home/fsuk/public_html/bla/changephotoparse.php on line 28[/quote] and code of line 28[code]unlink('http://fsuk.t1hosting.co.uk/bla/photos/'.$_SESSION['photo']);[/code] thanks please get back to me asapalso my permissions are fine Link to comment https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/ Share on other sites More sharing options...
stefpretty Posted April 7, 2006 Author Share Posted April 7, 2006 anyone??? :( Link to comment https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/#findComment-24714 Share on other sites More sharing options...
bradcis Posted April 7, 2006 Share Posted April 7, 2006 Are you sure you actually have file '15.jpg' in the photo directory (/home/fsuk/public_html/bla/photo/15.jpg)? This could be causing the error. Link to comment https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/#findComment-24723 Share on other sites More sharing options...
txmedic03 Posted April 7, 2006 Share Posted April 7, 2006 [code]if (file_exists('photo/'.$_SESSION['photo'])) { unlink('photo/'.$_SESSION['photo']) or die("Unlink problem!"); echo "File removed successfully.";} else { echo "Someone beat me to it. The file does not exist.";}[/code]This might help. Also you can't unlink a file on a remote server. You must use relative paths, so no unlink('http://myserver.com/filename').Check Appendix M on the [a href=\"http://www.php.net\" target=\"_blank\"]http://www.php.net[/a] site for more information.Let us know if you have any further problems. Link to comment https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/#findComment-24724 Share on other sites More sharing options...
kenrbnsn Posted April 7, 2006 Share Posted April 7, 2006 You have "/photos" as the directory in one line and "/photo" in the other. Which directory are you're photos stored in? Resolve this and your problem may go away. Ken Link to comment https://forums.phpfreaks.com/topic/6773-unlink-not-workin-error-message/#findComment-24751 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.