title: Form not submitting values to POST array PHP
body: <p>I have a form which can be seen below:</p>
  
  <pre><code>&lt;form id="myForm" action="register.php" method="POST"&gt;
      &lt;input type="text" name="email" id="email" onfocus="fieldSwap('inputhover.png')" 
          onblur="fieldSwap('inputnorm.png')"&gt;&lt;br/&gt;
      &lt;input type="image" src="submitnorm.png" name="submit" id="submit" 
          alt="submit button" onMouseOver="buttonSwap('submithover.png')" 
          onMouseOut="buttonSwap('submitnorm.png')" 
          onMouseDown="buttonSwap('submitclick.png')" 
          onMouseUp="buttonSwap('submitnorm.png')"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>It calls this script:</p>
  
  <pre><code>&lt;?php
      require_once 'db.php';
  
      $email = $_POST['email'];
      echo $email;
      echo "Register form";
      $sql-&gt;$db-&gt;prepare("INSERT INTO emails SET email = :email");
      $sql -&gt; bindValue(':email', $email, PDO::PARAM_STR);
      $sql -&gt; execute();
  
      // Redirect back to homepage
      header('Location: index.php');
      exit();
  ?&gt;
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <p><strong>Notice: Undefined index: email in C:\wamp\www\Holding page\register.php on line 3</strong></p>
  
  <p>What am I doing wrong? I understand that no index called email exists in the POST array but I am unsure why this is the case.
  Thanks!</p>