Jump to content

[SOLVED] Upload script suddenly produces error


fluteflute

Recommended Posts

I was playing with my upload script when I got the error:

faultCode0faultStringParse error:syntax error, unexpected '{' in /path/htdocs/upload.php on line 59

 

And I can't see where that unexpected '{' is!

<?php

if(!isset($_POST['Upload']))                           
  {
    echo "No File Selected<p>";
echo "<form action='upload.php' method='POST' enctype='multipart/form-data'>
<input type='hidden' name='MAX_FILE_SIZE' value='300000' />
<input type='file' name='pix' /><br />
<input type='submit' value='Add Stamps' name='Upload'></form>";

  }
  
  else   
  {
  
  
  
   $filename = $_FILES['pix']['name'];
   $ext  =  strrchr($filename,  ".");
                                                 
  
    if($_FILES['pix']['tmp_name'] == "none")            
    {
      echo "<b>File did not successfully upload. Check the 
            file size. File must be less than 500K.<br>";
      exit();
   }
    
  if($ext  !==  (".gif")           
    {
      echo "<b>File is not a .gif. Please try another 
            file.</b><br>";
      exit();
    }
    else                                                
    {
echo "Would have uploaded";
    
     
  /*  
      $destination = "images/".$_FILES['pix']['name'];
      $temp_file = $_FILES['pix']['tmp_name'];
      move_uploaded_file($temp_file,$destination);
      echo "<p><b>The file has successfully uploaded:</b>
            {$_FILES['pix']['name']}
            ({$_FILES['pix']['size']})</p>"; */
    }
  

}


?>

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.