I want it to check for blank text spots and if there is any, to echo with the "wrong image". If none are blank, for it send me an email. But it won't work correctly, it will always give me an email, when some textfileds are blank.
2007-06-11
15:57:11
·
3 answers
·
asked by
truepal20032001
2
in
Computers & Internet
➔ Programming & Design
// Prepare the variables for handling.
$name = ($_POST[name]);
$email = ($_POST[email]);
$phone = ($_POST[phone]);
$comment = ($_POST[comment]);
// Prepare the message feedback.
$msg = "Name: $name\n";
$msg.= "Email: $email\n";
$msg.= "Phone: $phone\n";
$msg.= "Message sent: ".date('m/d/y')."
$msg.= "Comment/Message:\n";
$msg.= "
$comment\n";
If ($name == NULL ||
$email == NULL ||
$comment == NULL)
{
$required=FALSE;
}
else{
$required = TRUE; }
If ($required === TRUE){
@mail('mail@yahoo.com','Comment/Message',$msg,'FROM:'.$_POST[email]);
echo "Thankyou!
You'll be replied soon.
";
echo '
';
}
else{
echo "ERROR!!
An error has just occured, these might have been the cause:
1. Did not fill in all of the neccessary blanks.
?>
2007-06-11
15:57:53 ·
update #1
ignore the "..." continuation of mail function, its complete, thats not the problem
2007-06-11
16:00:40 ·
update #2