I am using the following code to validate a name field, and an email. The email field validate works fine but the name field doesn't... it allows blank data to be sent. How can I make it work, and how can I compound these two instructions? (The custname part worked fine in another script, the code has not be changed at all!
if(!isset($CustName)) {
echo "<center>You must provide your name and E-mail address. Please go back to complete the order form. Jazzle Dazzle uses this information to contact you about your order. Thank you.<br>
<a href=\"program.php\">Go Back</a></center>";}
else{
$CustPhone="$AreaCode-$Prefix-$Suffix";
$CheckMail=eregi("[a-z0-9-]+(\.[a-z0-9-]+)@[a-z0-9-]+(\.[a-z0-9-]+)$", $CustEmail);
if ($CheckMail=="1") {
send order emails, etc
}
}