//If the submit button is clicked
if (isset($_POST['addnew'])){
//Insert values from the form into the DB
$query = "INSERT INTO tblguests(guest_name, guest_email, guest_phone, guest_address, guest_comments) VALUES ('".$_REQUEST['guest_name']."','".$_REQUEST['guest_email']."','".$_REQUEST['guest_phone']."','".$_REQUEST['guest_address']."','".$_REQUEST['guest_comments']."')";
$result = pg_query($query);
if ($result);
//echo "Comment successfully added";
{
echo "";
}
exit;
}//end if
//}else{
?>
//}end if
?>
|