title: php file upload system - Undefined index
body: <p>I get following errors and I don't know why.</p>
  
  <pre><code>Notice: Undefined index: myfile in C:\xampp\htdocs\upload.php on line 3
  Notice: Undefined index: myfile in C:\xampp\htdocs\upload.php on line 4
  Notice: Undefined index: myfile in C:\xampp\htdocs\upload.php on line 5
  Notice: Undefined index: myfile in C:\xampp\htdocs\upload.php on line 6
  Notice: Undefined index: myfile in C:\xampp\htdocs\upload.php on line 7
  </code></pre>
  
  <p>pls help , i m a beginner... My code:</p>
  
  <pre><code> &lt;html&gt;//this is index.html
  
   &lt;form action="upload.php" method="POST" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="myfile"&gt;File limit 1MB&lt;p&gt;
      &lt;input type="submit" value="Upload"&gt;
   &lt;/form&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>this is my upload.php script</p>
  
  <pre><code>&lt;?php //this is my upload.php script    
  $name = $_FILES["myfile"]["name"];
  $type = $_FILES["myfile"]["type"];
  $size = $_FILES["myfile"]["size"];
  
  $temp = $_FILES["myfile"]["tmp_name"]; 
  $error = $_FILES["myfile"]["error"];//size  
  if ($size &gt; 1000000){
  die("The file size is too big!");}
  
  else
  move_uploaded_file($temp, "uploaded/" .$name);//move upload file    
  ?&gt;
  </code></pre>