* Email not entered";$flag1 = "off"; // email red color
}
else{
/* Check if valid email address */
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
if(!eregi($regex,$subemail)){
$e_email = "* Email invalid"; $flag1 = "off";
}
else{ $flag1 = "on"; $e_email = "";}
}
}
//fname
if (isset($_POST["fname"])){
$subuser = $_POST["fname"]; //Use field name for username
if(!$subuser || strlen($subuser = trim($subuser)) == 0){
$e_fname = "* Name not entered";$flag2 = "off"; //username red color
}
else{
/* Spruce up username, check length */
$subuser = stripslashes($subuser);
if(strlen($subuser) < 2){
$e_fname = "* Name below 2 characters";$flag2 = "off";
}
else if(strlen($subuser) > 25){
$e_fname = "* Name above 25 characters";$flag2 = "off";
}
else{ $flag2 = "on"; $e_fname = "";}
}
}
//end_fname
//lname
if (isset($_POST["lname"])){
$subuser2 = $_POST["lname"]; //Use field name for username
if(!$subuser2 || strlen($subuser2 = trim($subuser2)) == 0){
$e_lname = "* Subject not entered"; $flag3 = "off"; // subject red color
}
else {
/* Spruce up username, check length */
$subuser2 = stripslashes($subuser2);
if(strlen($subuser2) < 2){
$e_lname = "* Subject below 2 characters";$flag3 = "off";
}
else if(strlen($subuser2) > 25){
$e_lname = "* Subject above 25 characters";$flag3 = "off";
}
else{ $flag3 = "on"; $e_lname = "";}
}
}
//end_fname
if ($flag1 == "on" and $flag2 == "on" and $flag3 == "on" ){ echo "
We have received your contact information. We will contact you with the details of the webinar soon. Thank you. And please feel free to browse around our website to learn more about us.
"; $sendTo = "[email protected], [email protected]"; $subject = "Free Webinar Registration Sign up:".$_POST["first"]." ".$_POST["last"]; $headers = "From: " . "SMB Training Registration Form"; $message = "First Name: " .$_POST["fname"]. "\r\n"; $message .= "Last Name: " .$_POST["lname"]. "\r\n"; $message .= "E-mail: " .$_POST["email"] . "\r\n"; $message .= "I would like to attend: " .$_POST["question2"] . "\r\n"; mail($sendTo, $subject, $message, $headers); $mmm = "ok"; // } else{ $mmm = "nook"; } ?>
We have received your contact information. We will contact you with the details of the webinar soon. Thank you. And please feel free to browse around our website to learn more about us.
"; $sendTo = "[email protected], [email protected]"; $subject = "Free Webinar Registration Sign up:".$_POST["first"]." ".$_POST["last"]; $headers = "From: " . "SMB Training Registration Form"; $message = "First Name: " .$_POST["fname"]. "\r\n"; $message .= "Last Name: " .$_POST["lname"]. "\r\n"; $message .= "E-mail: " .$_POST["email"] . "\r\n"; $message .= "I would like to attend: " .$_POST["question2"] . "\r\n"; mail($sendTo, $subject, $message, $headers); $mmm = "ok"; // } else{ $mmm = "nook"; } ?>
|