|
What is wrong with this script?
Learing PHP via online couse..but no one to bounce questions off of.
when the form processes it goes to the email verification error even if their is a valid email input. I have had problems with any of the>> !$variable << doing the same thing
Cheers!!
<body>
<?
if(!eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z0-9\-\.]+$", $email)){
?>
<H2>Whoops</H2>
<BR>
Please Enter a valid email adress.
<A HREF="feedback.html">Click here to go back to the feedback page</A>
<?
exit;
}
$user = addslashes($user);
$email = addslashes($email);
$comments = addslashes($comments);
$db = mysql_connect("localhost");
mysql_select_db("vinyldealers", $db);
$addfeedback = "INSERT INTO feedback(user, email, spam, comments)
VALUES ('$user', '$email', '$spam', '$comments')";
$result = mysql_query($addfeedback);
?>
<H2>Thank You</H2>
<BR>
We have added your comments to our database.
<A HREF="feedback.html">Click here to go back to the feedback page</A>
</body>
</html>
|