Page 1 of 1
Please help with Parse Error
Posted: Sat Dec 28, 2002 3:04 am
by urb
My error keep occuring after the very last line of code no matter what I do. The error reads
Parse error: parse error in /home/webtemp/public_html/new/template.php on line 350
On line 349 is the last actual line of code ending the html block </html>
Does anyone have any ideas of what might be happening.
Matt
Posted: Sat Dec 28, 2002 5:13 am
by Elmseeker
Can you please post the last few lines of PHP in here? including the ?> ? Also, make sure all of your (),{}, [], "", and '' sets are properly closed and all of your ;'s are in place. These are the most common reasons for getting a parse error.
Posted: Sat Dec 28, 2002 9:29 am
by Bill H
As elmseeker suggested, it's almost certain you aren't closing something.
most likely a {} pair.
Posted: Sat Dec 28, 2002 10:29 am
by Gen-ik
Bill H is right.. I get this error now and again as well and it's just down to you missing something out (or not closing something) in the PHP script.
You will just have to go through it line by line and track down the missing bit.
Posted: Sat Dec 28, 2002 12:35 pm
by oldtimer
Yeah. A missing {} will do that alot. Print out your code and then do what I do. Take a pencil and mark each one to make sure they all are in there.
Posted: Sat Dec 28, 2002 3:43 pm
by Takuma
Mine's got a simliar error and I can't work it out.
Check this out please:-
http://www.ticktaku2000.com/articles.php
Posted: Sat Dec 28, 2002 3:48 pm
by oldtimer
Parse error: parse error, unexpected $ in /usr/home/ticktaku/public_html/articles.php on line 367
Sounds like you have a $ out of place.
Posted: Sat Dec 28, 2002 11:03 pm
by Elmseeker
Takuma, do you have a $ you are trying to echo? like:
If so, you need to escape that $ making it:
this goes for prints and any other place where you have a $ and it's not meant as part of a variable...
Posted: Sun Dec 29, 2002 12:58 am
by Takuma
No I don't have anything like that...
Reply
Posted: Sun Dec 29, 2002 9:16 am
by James Pelow
Unexpected $ usually happens to me when I copy code out of one Encoding into a new encoding. Replace all the whitespaces and line breaks with new ones - or pinpoint it by displaying as source (.phps file).
-James