insert.php
<?php
$db = new mysqli("localhost", "root", "","test");
$rs=$db->query ("INSERT INTO form (name,email,address) VALUES ('".$_POST['name']."','".$_POST['email']."','".$_POST['address']."')
");
// json output to notify the insert is success or not
if ($rs) {
echo '{"success":"true"}';
}
else {
echo '{"success":"false"}';
}
?>
Comments 0