title: PHP undefined image
body: <pre><code>session_start(); 
  $_SESSION['id'] = '$id';
  $_SESSION['name'] = '$name';
  $_SESSION['phone'] = '$phone';
  $_SESSION['email'] = '$email';
  $_SESSION['image'] = '$image';
  $_SESSION['error'] = '$error';
  
  &lt;form id="formm" action="" method="post"&gt;
  &lt;strong&gt;Image: *&lt;/strong&gt; &lt;input type="file" src=images id="imageUpload" name="imageUpload"value="&lt;?php echo $image; ?&gt;"/&gt;
  </code></pre>
  
  <p><strong>add-student.php</strong></p>
  
  <pre><code>$name = $_POST['name'];
  $phone = $_POST['phone'];
  $email = $_POST['email'];
  $image = $_POST['image'];
  $target_dir = "images/";
  $target_file = $target_dir . basename($_FILES["imageUpload"]["name"]);
  $uploadOk = 1;
  $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
  if (move_uploaded_file($_FILES["imageUpload"]["tmp_name"], $target_file)) {
  echo "The file ". basename( $_FILES["imageUpload"]["name"]). " has been uploaded.";
  }
  </code></pre>
  
  <p>I get an error message:</p>
  
  <blockquote>
    <p><strong>Undefined index:</strong> imageUpload</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>