unistake Posted January 26, 2009 Share Posted January 26, 2009 Hi guys, Fairly new to PHP... Is it possible to include several conditions in one IF statement. It is instead of making a register form like this.. <?php if ($user == "") { echo "please enter a username"; } if ($password == "") { echo "please enter a password"; } if ($email == "") { echo "please enter an email address"; } ?> Im looking for something like!.... <?php if ($user and $password and $email == 0) { echo "you need to fill in all the form!"; } ?> Mucho Gracias! Link to comment https://forums.phpfreaks.com/topic/142482-several-if-conditions-in-one-is-it-possible/ Share on other sites More sharing options...
rhodesa Posted January 26, 2009 Share Posted January 26, 2009 <?php if ($user == "" || $password == "" || $email == "") { echo "you need to fill in all the form!"; } ?> Link to comment https://forums.phpfreaks.com/topic/142482-several-if-conditions-in-one-is-it-possible/#findComment-746553 Share on other sites More sharing options...
unistake Posted January 26, 2009 Author Share Posted January 26, 2009 wow less than 5mins response! thanks a bunch Link to comment https://forums.phpfreaks.com/topic/142482-several-if-conditions-in-one-is-it-possible/#findComment-746557 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.