How To Fix: Parse Error: Parse Error, Unexpected T_IF In Php On Line 36



How To Fix: Parse Error: Parse Error, Unexpected T_IF In Php On Line 36
 (380) Click. Work. Collect
How To Fix: Parse Error: Parse Error, Unexpected T_IF In Php On Line 36
Post Description:
Post Tags: how, to, fix, parse, error, parse, error, unexpected, t, if, in, php, on, line, 36
This Post Has Been Viewed 568 Times Since Sun Jun 03, 2007 7:05 pm Posted By hostman with 2 replies
How To Fix: Parse Error: Parse Error, Unexpected T_IF In Php On Line 36
if you are wondering why you are gettin this error on your php scripts i will give you the answer.

hi, my name is hostman, i am with Webune.com Support - I help many people with php. If you ever need PHP hosting, Visit Webune.

I was writing a script with PHP and i kept getting this error and wondered what the heck is wrong here, but i couldn't see the what was wrong on my script, till finally i found it and fixed it, so i though i post it here just in case there is anyone who might need some help on this.

this the error i got:
Parse error: parse error, unexpected T_IF in C:htdocsmyscript.php on line 36


and this is how my code looked like on like around 36

Line 36: if(!$_POST[name] && !$_POST[pass]
Line 37: {
Line 38: $error = "invalid password ";
Line 39: echo form($error);
Line 40: }
Line 41: else


ok, as you can see, the problem is that i don't have a ) at the end of !$_POST[pass] so all i had to do is put a ) at the end and it worked.

so basically, if you are getting this error is because you might be missing a closing bracket or parentesis.


Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Fix: Parse Error: Parse Error, Unexpected T_IF In Php On Line 36




:: 1 :: #7840 - Reply By need help with T_IF ERROR On Sat Jun 23, 2007 5:54 am
add me if you can help me please
it says t_if error on line 12
line 12: if (mysql_num_rows($uq)==0)
line 13:
:: 2 :: #7858 - Reply By hostman On Sat Jun 23, 2007 8:24 am
i've seen this error, its because you don't have a closing braker on your if/else statement. this is the character you are missing: }