You are on page 1of 1

<?php $con=mysql_connect("localhost","root",""); if(!$con) { die("error in database".mysql_error()); } $a=$_POST['name']; $b=$_POST['email']; $c=$_POST['comment']; mysql_select_db("site",$con); $res=mysql_query("insert into post values('$a','$b','$c')"); if(!

$res) { die("error in query"); } else { ?> <script type="text/javascript"> alert("Thank you for posting a comment. Your comment will appear post moderation ."); </script> <?php } include'index.php'; mysql_close($con); ?>

You might also like