dysfunctionGazz
04-27-2005, 04:00 PM
I got overconfident and added in an IF/ELSE statement to my formhandler. However even if I dont enter an email value, and just click send, it doesn't get to the ELSE part, so basically tis not working!
Can anyone see the error?
if (isset($_POST['email'])) {
$email=$_POST['email'];
echo "The address " . $email . " has been added to the database.";
$query = "INSERT INTO mailinglist VALUES ('','$email',NOW())";
mysql_query($query);
mysql_close();
echo "Thank you for joining our mailing list.<p>";
}
else {
echo "You did not enter an email address!";
}
Can anyone see the error?
if (isset($_POST['email'])) {
$email=$_POST['email'];
echo "The address " . $email . " has been added to the database.";
$query = "INSERT INTO mailinglist VALUES ('','$email',NOW())";
mysql_query($query);
mysql_close();
echo "Thank you for joining our mailing list.<p>";
}
else {
echo "You did not enter an email address!";
}