futurewii Posted June 19, 2008 Share Posted June 19, 2008 Hey I get the error.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /mounted-storage/home36c/sub005/sc28991-YIVP/futurewii.com/upload_file.php on line 33 On this script.. <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/png")) && ($_FILES["file"]["size"] < 50000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 50000) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " Sorry, someone (maybe you) has already uploaded the same Picture! "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "/images/uploads/" . $_FILES["file"]["name"]); echo "Here the code to add to your Review.." . "<img src=http://www.futurewii.com/images/uploads/" . $_FILES["file"]["name"] . ">; } } } else { echo "Invalid file"; } ?> Any help much appreciated Plus if anyone knows how i can limit the uploaded file dimensions to 450px wide please let me know Much appreciated. Link to comment https://forums.phpfreaks.com/topic/110965-quick-fix-please-where-do-i-put-the/ Share on other sites More sharing options...
ober Posted June 19, 2008 Share Posted June 19, 2008 echo "Here the code to add to your Review.." . "<img src=http://www.futurewii.com/images/uploads/" . $_FILES["file"]["name"] . ">"; You are missing a quotation mark (bolded). And just call "getimagesize()" on the image after uploading to determine the size. Link to comment https://forums.phpfreaks.com/topic/110965-quick-fix-please-where-do-i-put-the/#findComment-569285 Share on other sites More sharing options...
futurewii Posted June 19, 2008 Author Share Posted June 19, 2008 ah ha, thank you very much and i was wanting a script where if the width of the picture is over 450px it says Imagetoo Large or something Tanke Schon Link to comment https://forums.phpfreaks.com/topic/110965-quick-fix-please-where-do-i-put-the/#findComment-569315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.