I have a simple contact for that writes input to a database, and then another page that I can go to, to check the output. Is there some code I can add to my contactinfo.php file to e-mail me when somebody adds something to the db? It doesn’t matter if the e-mail doesn’t contain the info just entered, I would just like to have notification when somebody enters data into the contact form. Here’s my code:
HTML
[CODE]
<form action=”contactinfo.php” method=”post”>
Name:<input type=”text” name=”vName” size=”30″><br>
E-Mail Address:<input type=”text” name=”vEmail” size=”30″><br>
<input class=”send” type=”submit” value=”Send Away!” />
</form>
contactinfo.php
[CODE]
<?
mysql_connect(“$host”, “$user”, “$password”) or die(mysql_error());
mysql_select_db(“$database”) or die(mysql_error());
$name=$_POST[‘vName’];
$email=$_POST[‘vEmail’];
mysql_query(“INSERT INTO users
(name, email) VALUES(‘$name’, ‘$email’) “)
or die(mysql_error());
echo “<h1>Thank You!</h1><br>”;
echo “<a href=’index.html’>Back home</a>”;
?>