Hello... I'm a newbie with a question.

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
Deeve
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 3:02 pm

Hello... I'm a newbie with a question.

Post by Deeve »

I am very new to php. I have done some mods on my board successfully but I'm stuck at a point where I have one parse error. I read somewhere about a "parser"... is there a program to run these through to fix them? How does one fix a parse error? In case this will help, here's the error I get.

Code: Select all

Parse error: parse error, expecting `')'' in
/home/httpd/htdocs/phpbb/includes/usercp_register.php on line 940

Thanks in advance for any advice you can offer. :)
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

When you write code and execute it in the browser the php.exe file on the webserver 'parses' the code. If the code does not comply to php syntax you get a parse error. The error messages are very useful for solving these errors.

Let's take yours for example:
Parse error: parse error, expecting `')'' in
/home/httpd/htdocs/phpbb/includes/usercp_register.php on line 940
It simply means the parser was looking for a ) and could not find it on line 940.

Go back to that line in your source code (if you have an editor with a counter, i feel sorry for you if you dont ;)) and investigate. Usually the errors are quite stupid mistakes you made when coding without double checking what you just typed.

Hope it helps.
Deeve
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 3:02 pm

Post by Deeve »

Well, that's where I am lost. I went to that line, and it isn't one that I touched. I didn't touch anything near it either. Here is the line of code at 940

Code: Select all

'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $langї'password_confirm_if_changed'] : '',
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

a few lines before and after would help.
I assume from that snippet that the line is part of an array declaration which attributes either an empty string or the value of a different array index dependent upon a test.
If the parent array that that declaration is in ends on that line, you should remove the comma and replace with a closing parenthesis and semi-colon );
Deeve
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 3:02 pm

Post by Deeve »

Thank you kindly... I'll look at that! :)
Post Reply