KkillgasmM Posted May 31, 2007 Share Posted May 31, 2007 Ive decided to cut the script down a lot since my last thread, in order to make it easier to find an error. i just keep getting the error message under the else statement! Ive made sure that all of the folder permissions are on full and it doesnt fix the problem. Also, ive made sure that the directory actually exists and it does. <?php $target="Images/workpics/"; $mode=0777; $target=$target.'pic.jpg'; chmod($target, $mode) if(move_uploaded_file($_FILES['file']['tmp_name'], $target)) { echo 'worked'; } else { echo 'error'; } ?> I've been looking ALL over the web and i just cant figure out why it wont work. maybe its a problem with the server? Please help me as it is quite urgent! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/53803-php-script-is-anything-actually-wrong-with-this/ Share on other sites More sharing options...
papaface Posted May 31, 2007 Share Posted May 31, 2007 Try: <?php $target= "Images/workpics/"; $mode= 0777; $target= $target . 'pic.jpg'; chmod($target, $mode); $move = move_uploaded_file($_FILES['file']['tmp_name'], $target); if($move) { echo 'worked'; } else { echo 'error'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/53803-php-script-is-anything-actually-wrong-with-this/#findComment-265925 Share on other sites More sharing options...
KkillgasmM Posted May 31, 2007 Author Share Posted May 31, 2007 Thanks, but it still doesnt work! ??? Quote Link to comment https://forums.phpfreaks.com/topic/53803-php-script-is-anything-actually-wrong-with-this/#findComment-265933 Share on other sites More sharing options...
KkillgasmM Posted June 1, 2007 Author Share Posted June 1, 2007 Ahhh never mind, it IS a problem with the server! Quote Link to comment https://forums.phpfreaks.com/topic/53803-php-script-is-anything-actually-wrong-with-this/#findComment-265934 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.