title: Form feedback without a page refresh
body: <p>I'm getting my feet wet with form processing so bear with me. I have a basic HTML form and a script that sends mail. At the moment it sends and refreshes to give feedback. What I would like is if the feedback could be given without refreshing the page.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;E-Mail Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="beta_sendmail.php" method="POST"&gt;
  &lt;p&gt;&lt;strong&gt;Name: &lt;/strong&gt;&lt;br/&gt;
  &lt;input type="text" size="25" name="name" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;E-Mail Address: &lt;/strong&gt;&lt;br /&gt;
  &lt;input type="text" size="25" name="email" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;Message: &lt;/strong&gt;&lt;br /&gt;
  &lt;textarea name="message" cols="30" rows="5"&gt;&lt;/textarea&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="submit" value="send" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the PHP</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Mail Sending Script&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  echo "&lt;p&gt;Thank you, &lt;b&gt;".$_POST["name"]."&lt;/b&gt;, for your message!&lt;/p&gt;";
  echo "&lt;p&gt;Your email address is: &lt;b&gt;".$_POST["email"]."&lt;/b&gt;.&lt;/p&gt;";
  echo "&lt;p&gt;Your message was: &lt;br/&gt;";
  echo $_POST["message"]."&lt;/p&gt;";
  //start building the mail string
  $msg = "Name: ".$_POST["name"]."\n";
  $msg .= "E-Mail: ".$_POST["email"]."\n";
  $msg .= "Message: ".$_POST["message"]."\n";
  //set up the mail
  $recipient = "mailto@me.com";
  $subject = "Form Submission Results";
  $mailheaders = "From: My Web Site &lt;defaultaddress@yourdomain.com&gt; \n";
  $mailheaders = "Reply-To: ".$_POST["email"];
  //send the mail
  mail($recipient, $subject, $msg, $mailheaders);
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>