title: php with form alert box
body: <p>I would like this <code>php</code> form to pop up an alert box on completion or if there is error.
  What do I need to add or change to this to make that happen, or is that added <code>javascript</code>?</p>
  
  <pre><code>&lt;?php
      $name = $_POST['fullname'];
      $email = $_POST['email'];
      $message = $_POST['comment'];
      $from = 'From: Contact Form'; 
      $to = 'email@domain.com'; 
      $subject = 'Hello';
  
  
      $body = "From: $name\n E-Mail: $email\n Message:\n $message";
  
      if (mail ($to, $subject, $body, $from)) { 
          echo '&lt;p&gt;Your message has been sent!&lt;/p&gt;';
      } else { 
          echo '&lt;p&gt;Something went wrong, go back and try again!&lt;/p&gt;'; 
      }
  
  ?&gt;
  </code></pre>