I have this very easy form to store info in a database table but i would like to be emailed once somebody has entered the details, how would i do this please?
Form
<form action="insert.php" method="post">
<div align="center">Firstname:
<input type="text" name="firstname" />
Lastname:
<input type="text" name="lastname" />
Email:
<input type="text" name="email" />
<input type="submit" />
</div>
</form>
Insert.php
<?php
$con = mysql_connect("x","x","x");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("x", $con);
$sql="INSERT INTO Persons (FirstName, LastName, Email)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[email]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Thank you you will recieve information shortly";
mysql_close($con)
?>