Click to See Complete Forum and Search --> : if statement help


Sux0rZh@jc0rz
12-26-2003, 08:23 PM
how would one go about joining multiple if statements into one? right now i have the code: if (!empty($username)) (!empty($password)) {
echo "ello"
} but it doesnt work...

Jeff Mott
12-26-2003, 08:39 PM
The logical AND operator (http://www.php.net/manual/en/language.operators.logical.php).if (!empty($username) and !empty($password))orif (!(empty($username) or empty($password)))

Sux0rZh@jc0rz
12-26-2003, 08:40 PM
k. ty. lots easier than putting mass { and } in there.

AdamBrill
12-28-2003, 12:53 PM
You can also use the regular C style:

if (!empty($username) && !empty($password))

and:

if (!empty($username) || !empty($password))