Jump to content

Several IF conditions in one.. is it possible?


unistake

Recommended Posts

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!

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.