title: submit form to self
body: <p>At the moment, I have a form with an input (text) and a button to submit the form. </p>
  
  <p>The form is posted to 'submit.php'. I would like the form posted to same page as the form.</p>
  
  <p>How can I do this?</p>
  
  <pre><code>&lt;form action="submit.php" method="POST"&gt;
      &lt;input type="text" class="emailField" placeholder="email address" name="email" /&gt;
      &lt;button type="submit"&gt;
          &lt;div class="submit" /&gt;
      &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>submit.php</p>
  
  <pre><code>&lt;?php
      mysql_connect('localhost', '', '') or die('unable to connect');
      mysql_select_db('') or die('unable to select db');
      $query = mysql_query("");
      if (mysql_num_rows($query) &gt; 0) {
          exit("You have already subscribed!");
      }
      else {
          mysql_query("") or die(mysql_error());
          exit("You have successfully subscribed!");
      }
  
  ?&gt;
  </code></pre>