title: Display popup message after record has been added to mysql database using html form
body: <p>I have the following html form:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="insert.php" method="post"&gt;
  Firstname: &lt;input type="text" name="firstname" /&gt;
  Lastname: &lt;input type="text" name="lastname" /&gt;
  Age: &lt;input type="text" name="age" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is the .php file:</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","peter","abc123");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("my_db", $con);
  
  $sql="INSERT INTO Persons (FirstName, LastName, Age)
  VALUES
  ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
  
  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  echo "1 record added";
  
  mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>How do I get a popup message that displays for 2 seconds after a record has been submitted that says for example "Record added"</p>