Jump to content

Quick Fix Please, Where do I put the ;


futurewii

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.