Jump to content

contact form question


lialight

Recommended Posts

Hello, I am relatively new to PHP I have a basic understanding though. I have a form to e-mail contact form....
It needs the user to fill in either their phone or the e-mail field. It doesn't need both, just one or the other. I need help forming the if statement for this situation.

if(empty($phone)) || (empty($email)) {
echo "<b>Please GO BACK and fill in either your email or phone\n";
$error = true;
}

but if the phone is empty and the email is filled in or vice versa, I want the form to be sent so I think I am missing some pieces. Can someone please help me?!?
Link to comment
https://forums.phpfreaks.com/topic/33234-contact-form-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.