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
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
Post Description: how to fix: parse error: parse error, unexpected t_if in php on line 36
POST# 649
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: 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.

Share:
BBCODE:
HTML Code:


Sat Jun 23, 2007 5:54 am
1
need help with T_IF ERROR
Reply #1510
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:
Sat Jun 23, 2007 8:24 am
2
hostman
Reply #1511
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: }

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload