title: Popup Window and PHP form
body: <p>I've created a contact page and a separate PHP page to receive the posted data. I'd like to make the PHP open in a popup window. I've tried methods online without any success, I can make the popup appear but i cant make the PHP send the data.</p>
  
  <pre><code>&lt;!------Contact Page-------&gt;
  
  &lt;form method='post' action='sendemail.php' &gt;
      &lt;label&gt;Name&lt;/label&gt;
      &lt;input name="name" placeholder="Type Here"&gt;
      &lt;label&gt;Email&lt;/label&gt;
      &lt;input name="email" placeholder="Type Here" id="email"&gt;
      &lt;label&gt;Message&lt;/label&gt;
      &lt;textarea name="message" placeholder="Type Here"&gt;&lt;/textarea&gt;
  
  
      &lt;label&gt;Human Verification&lt;/label&gt;
        &lt;input name="human" placeholder="2 + 2 = ? " id="human"&gt;
        &lt;input id="submit" name="submit" type="submit" value="Submit"&gt;
      &lt;/label&gt;     
  &lt;/form&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;?php
      $name = $_POST['name'];
      $email = $_POST['email'];
      $message = $_POST['message'];
      $from = $email; 
      $to = 'my@email.com'; 
      $subject = 'New Message';
      $human = $_POST['human'];
  
      $body = "From: $name\n E-Mail: $email\n Message:\n $message";
  
      if ($_POST['submit']) {
          if ($name != '' &amp;&amp; $email != '') {
              if ($human == '4') {                 
                  if (mail ($to, $subject, $body, $from)) { 
                      echo '&lt;h4&gt;Your message has been sent!&lt;/h4&gt;';
              } else { 
                  echo '&lt;h4&gt;Something went wrong, go back and try again!&lt;/h4&gt;'; 
              } 
          } else if ($_POST['submit'] &amp;&amp; $human != '4') {
              echo '&lt;h4&gt;You answered the anti-spam question incorrectly!&lt;/h4&gt;';
              }
          } else {
              echo '&lt;h4&gt;You need to fill in all required fields!!&lt;/h4&gt;';
          }
      }
  ?&gt;
  </code></pre>