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>"; */
    }
  

}


?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.