title: PHP Image Upload Strange Issue
body: <pre><code>&lt;?
  if(isset($_POST['submit'])){
  
  $url = 'http://www.connectedcampus.org/ckeditor/images/uploads/';
  
  if (($_FILES['upload'] == "none") OR (empty($_FILES['upload']['name'])) )
  {
     $message = "No file uploaded.";
  }
  else if ($_FILES['upload']["size"] == 0)
  {
     $message = "The file is of zero length.";
  }
  else if (($_FILES['upload']["type"] != "image/pjpeg") AND ($_FILES['upload']["type"] != "image/jpeg") AND ($_FILES['upload']["type"] != "image/png"))
  {
     $message = "The image must be in either JPG or PNG format. Please upload a JPG or PNG instead.";
  }
  else if($_FILES["file"]["size"] &gt; 1000000){
      $message = "File size too big!";
  }
  else if(file_exists($url.$_FILES["file"]["name"]))
    {
    $message=$_FILES["file"]["name"] . " already exists. ";
    }
  else if (!is_uploaded_file($_FILES['upload']["tmp_name"]))
  {
     $message = "Invalid File!";
  }
  else {
    $message = "success!";
    $move = move_uploaded_file($_FILES['upload']['tmp_name'], $url.$_FILES['upload']['name']);
    echo $_FILES['upload']['tmp_name']."&lt;br&gt;";
    echo $url.$_FILES['upload']['name'];
    if(!$move)
    {
       $message = "Error moving uploaded file.";
    }
    $url = $url.$_FILES['upload']['name'];
  }
   echo $message;
   &lt;/script&gt;";
   }
   ?&gt;
  </code></pre>
  
  <p>This prints "Error moving uploaded file"
  Which means move_uploaded_file($_FILES['upload']['tmp_name'], $url.$_FILES['upload']['name'])
  returns false. But I am 500% sure that i have created <a href="http://www.connectedcampus.org/ckeditor/images/uploads/" rel="nofollow">http://www.connectedcampus.org/ckeditor/images/uploads/</a> folder properly.... then why is there an error?</p>
  
  <p>Ok, now changed to:</p>
  
  <pre><code>$url = 'bloguploads/';
  
      if (($_FILES['upload'] == "none") OR (empty($_FILES['upload']['name'])) )
      {
         $message = "No file uploaded.";
      }
      else if ($_FILES['upload']["size"] == 0)
      {
         $message = "The file is of zero length.";
      }
      else if (($_FILES['upload']["type"] != "image/pjpeg") AND ($_FILES['upload']["type"] != "image/jpeg") AND ($_FILES['upload']["type"] != "image/png"))
      {
         $message = "The image must be in either JPG or PNG format. Please upload a JPG or PNG instead.";
      }
  else if($_FILES["file"]["size"] &gt; 1000000){
         $message = "File size too big!";
  }
  else if(file_exists($url.$_FILES["file"]["name"]))
      {
         $message=$_FILES["file"]["name"] . " already exists. ";
      }
      else if (!is_uploaded_file($_FILES['upload']["tmp_name"]))
      {
         $message = "Invalid File!";
      }
      else {
         $message = "";
         $move = move_uploaded_file($_FILES['upload']['tmp_name'], $url.$_FILES['upload']['name']);
         if(!$move)
         {
             $message = "Error moving uploaded file.";
         }
         $url = $url.$_FILES['upload']['name'];
         }
  echo $message;
  &lt;/script&gt;";
  ?&gt;
  </code></pre>
  
  <p>Now the thing is, it says "already exists". Why? I can see via the ftp client that file has not been uploaded</p>