Hey there,
I have two email forms on http://www.supernerd.ca/contact.php and no matter which one you fill out they both give you the success message in green.
They use the same code but with all different variables and stuff. Why is this happening and how to i make it so only the one that is being submitted returns the message..
here is the code for both,
the one on the left
<?
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$phone = $_REQUEST['phone'] ;
$adress = $_REQUEST['adress'] ;
$type = $_REQUEST['type'] ;
$service = $_REQUEST['service'] ;
$subject = "Appointment Request From Supernerd.ca" ;
$message = "
Name: "."$name"."
Email: "."$email"."
Phone Number: "."$phone"."
Adress: "."$adress"."
Type: "."$type"."
Service: "."$service"."
";
if (isset($_REQUEST['email'])) <------ THIS IS WHERE THE ERROR HAPPENS
//if "email" is filled out, send email
{
mail( "pj@supernerd.ca", "$subject",
$message, "From: $email" );
echo "Thanks!, Someone will be in touch with you within 24 hours";
}
else{
?>
Fill out the form bellow to setup an appointment
<?
}
?>
the one on the right:
<?
$nameRIGHT = $_REQUEST['nameRIGHT'] ;
$emailRIGHT = $_REQUEST['emailRIGHT'] ;
$mess = $_REQUEST['mess'] ;
$subjectRIGHT = "General contact From Supernerd.ca" ;
$messageRIGHT = "
Name: "."$nameRIGHT"."
Email: "."$emaiRIGHT"."
Message: "."$mess"."
";
if (isset($_REQUEST['emailRIGHT'])) <----- AND HERE, YET THEY ARE BOTH NAMED DIFFERENT THINGS..???
{
mail( "pj@supernerd.ca", "$subjectRIGHT",
$messageRIGHT, "From: $emailRIGHT" );
echo "Thanks!, Someone will be in touch with you within 24 hours";
}
else{
?>
Fill out the form bellow to send us an email
<?
}
?>
As you see where i have put arrows, the names are completely different yet they BOTH return the success message..