title: How to get php echo and die messages to work with jQuery notice plugin
body: <p>I've created a contact form and it's set up to send the form contents via a mail.php file. At the moment it brings up a success/error message on a new blank page via echo and die respectively, but I want to have some kind of notification that pops up on the current page instead.</p>
  <p>The solution I'd like to use is <a href="http://www.sandbox.timbenniks.com/projects/jquery-notice/" rel="nofollow noreferrer">http://www.sandbox.timbenniks.com/projects/jquery-notice/</a>, but the demo on that site uses an example of adding the notification to a button. What I need to do is add the notification in place of the echo or die output message. Is this possible?</p>
  <p>Here's the mail.php code I'm using...</p>
  <pre><code>&lt;?php $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    if (isset($_POST['service'])) {
      $service = $_POST['service'];
      // $service is an array of selected values
    }
    $message = $_POST['message'];
    $formcontent=&quot; Message received from wwww.jhnormanandsons.co.uk: \n \n From: $name \n Phone: $phone \n \n Service required: $service \n \n Message: $message&quot;;
    $recipient = &quot;jasonbradberry@gmail.com&quot;;
    $subject = &quot;You have a new message from $name&quot;;
    $mailheader = &quot;From: $email \r\n&quot;;
    mail($recipient, $subject, $formcontent, $mailheader) or die(&quot;Error!&quot;);
    echo (&quot;Thank you for your message. We'll be in touch as soon as we can.&quot;);
  ?&gt;
  </code></pre>
  <p>Here's the form HTML...</p>
  <pre><code>&lt;form id=&quot;contact-form&quot; method=&quot;post&quot; action=&quot;mail.php&quot; name=&quot;jh_contact&quot;&gt;
    &lt;input type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot; placeholder=&quot;Name&quot; required /&gt;
    &lt;input type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot; required /&gt;
    &lt;input type=&quot;tel&quot; id=&quot;phone&quot; name=&quot;phone&quot; placeholder=&quot;Phone&quot; required /&gt;
    &lt;textarea id=&quot;message&quot; name=&quot;message&quot; placeholder=&quot;Message&quot; required &gt;&lt;/textarea&gt;
    &lt;select name=&quot;service&quot;&gt;
      &lt;option&gt;Service required&lt;/option&gt;
      &lt;option value=&quot;MOT&quot;&gt;MOT&lt;/option&gt;
      &lt;option value=&quot;Service / repairs&quot;&gt;Service / repairs&lt;/option&gt;
      &lt;option value=&quot;Cars for sale&quot;&gt;Cars for sale&lt;/option&gt;
      &lt;option value=&quot;Welding&quot;&gt;Welding&lt;/option&gt;
      &lt;option value=&quot;Exhausts&quot;&gt;Exhausts&lt;/option&gt;
      &lt;option value=&quot;Tyres&quot;&gt;Tyres&lt;/option&gt;
      &lt;option value=&quot;Brakes&quot;&gt;Brakes&lt;/option&gt;
      &lt;option value=&quot;Diagnostics&quot;&gt;Diagnostics&lt;/option&gt;
      &lt;option value=&quot;Vehicle checks&quot;&gt;Vehicle checks&lt;/option&gt;
      &lt;option value=&quot;Courtesy car&quot;&gt;Courtesy car&lt;/option&gt;
      &lt;option value=&quot;Advice&quot;&gt;Advice&lt;/option&gt;
      &lt;option value=&quot;Other&quot;&gt;Other&lt;/option&gt;
    &lt;/select&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Send&quot; id=&quot;submit-button&quot; name=&quot;submit&quot; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>Thanks!</p>