Weird error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rfigley
Forum Commoner
Posts: 70
Joined: Sun Apr 21, 2002 7:10 pm

Weird error

Post by rfigley »

I'm getting this error for my script:

Parse error: parse error, unexpected $ in /home/name/public_html/page.php on line 65

This is a blank line after the script ends. Must be something in the code causeing it but no idea what?
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

whats on line 60, 61, 62, 63, 64 and 65????
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

You probably just put a $ where it shouldn't be....like if you did this:

Code: Select all

if(session_is_registered("$registered"))
and it should be:

Code: Select all

if(session_is_registered("registered"))
that may be the kind of thing you did, so just check. If not, it would be nice to see line 65.

later on, -Brian
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Re: Weird error

Post by gite_ashish »

Hi,

ERROR:

Parse error: parse error, unexpected $ in /home/name/public_html/page.php on line 65

:idea: >> This is a blank line after the script ends. <<

The above line is important. If line 65 is the last line, then i think you are having some { or } mismatch.

Check the constructs like - if, else, while, for - etc.

All the best,
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

hey, Gite, I had actually suggested the same thing, then edited my entry otherwise. Would it give you an error concerning '$' if it was '{}' problem? I wasn't sure.

later on, -Brian
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you may use the command line version of the php interpreter with the -l option to only check the syntax of a script.
This is sometimes useful because you can comment out blocks or lines of code and check the script again to find the faulty part of it without running the partial script (if working).
Post Reply