lialight Posted January 7, 2007 Share Posted January 7, 2007 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 More sharing options...
paul2463 Posted January 7, 2007 Share Posted January 7, 2007 [code]<?phpif((empty($phone)) && (empty($email)) // if both are empty{echo "Please GO BACK and fill in either your email or phone\n"; $error = true;}>?[/code] Link to comment https://forums.phpfreaks.com/topic/33234-contact-form-question/#findComment-155154 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.