...

View Full Version : T_IS_EQUAL Problem



tyanque
02-15-2008, 08:29 PM
Hey, ive got a T_IS_EQUAL error and i cant see what the problem is

error:

Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' in filename.php on line 42

Line 42:

if (isset($_POST['username'], $_POST['userType']==1)){

thanks :)

tyanque

Fumigator
02-15-2008, 08:41 PM
Your "if" statement is screwy, that's why. Use && to test for true on both conditions, use || to test for true on just one of the condition.

tyanque
02-15-2008, 08:46 PM
Thank for reply

&& gives:

Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in filename.php on line 42

and || gives:

Parse error: syntax error, unexpected T_BOOLEAN_OR, expecting ',' or ')' in filename.php on line 42

Did you mean changing the if statement to && or ||?

tomws
02-15-2008, 09:44 PM
Change it from:

if (isset($_POST['username'], $_POST['userType']==1)){

to

if (isset($_POST['username']) && isset($_POST['userType']==1)){

Or use the || (or) instead. Whatever you need.

Fumigator
02-15-2008, 10:29 PM
Tomws that's still wrong.

Tyanque I would suggest you do some research into basic PHP syntax. Google is your friend (as is the PHP manual).

tomws
02-15-2008, 10:32 PM
Tomws that's still wrong.


Blast... that's what I get for a quick copy/paste.

How's this?

if (isset($_POST['username']) && isset($_POST['userType'])){



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum