title: Trouble moving picture with move_uploaded_file()
body: <p>I'm trying to set up some image handling for a webpage I'm creating, but I can't get move_uploaded_file() to work properly... I keep getting these errors:</p>
  
  <pre><code>Warning: move_uploaded_file(/htdocs/PHP/Pictures/picture.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /opt/lampp/htdocs/PHP/useredit.php on line 17
  
  Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpY0KKxH' to '/htdocs/PHP/Pictures/picture.jpg' in /opt/lampp/htdocs/PHP/useredit.php on line 17
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>if(isset($_FILES['image_file']))
  {
      $img_tmp_name = $_FILES['image_file']['name'];
      $img_dir = "/htdocs/PHP/Pictures/";
      $img_name = $img_dir . $img_tmp_name;
      if(move_uploaded_file($_FILES['image_file']['tmp_name'],$img_name))
      {
          list($width,$height,$type,$attr) = getimagesize($img_name);
          switch($type)
          {
              case 1:
                  $ext = ".gif";
                  break;
              case 2:
                  $ext = ".jpg";
                  break;
              case 3:
                  $ext = ".png";
                  break;
              default:
                  echo "Image format not accepted";
          }
          $query = "UPDATE profile_pic SET img_path=$img_name WHERE uid='$uid'";
          $img_id = mysql_insert_id();
          $new_img_name = $img_dir . $img_id . $ext;
          rename($img_name, $new_img_name);
      }
  }
  if(mysql_query($query)or die('Error: ' . mysql_error()))
  {
      header("Refresh:0; url='control.php'");
  }
  </code></pre>
  
  <p>The folder PHP/Pictures exist. How do I fix this?</p>