>Next I'd just like to confirm that the fields are not blank and send a
>custom error message.   But I think I'm confused about where to place the
>code.

Where you currently have "if ($send != "no"){ ... }" you could tack on
something like:

else{
  echo $name_err;
  echo $email_err;
  echo $lastname_err;
}


Once that works, as an improvement, it might make more sense to do like
this:

$message = '';
if ($name == ''){
  $message .= "Name must be provided.<BR>\n";
}
if ($email == ''){
  $message .= "Email must be provided.<BR>\n";
}
if ($lastname == ''){
  $message .= "Last name must be provided.<BR>\n";
}
if (!$message){
  # Send the email.
}
else{
  echo "<FONT COLOR=FF0000>$message</FONT>\n";
}

By using $message and .= to "tack on" the messages, you can avoid having so
many variables running around confusing you and get the job done just as
well.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to