Help - Search - Members - Calendar
Full Version: Php Error
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Programming & Web Development
error404
I am currently installing a mod however once I did you couldn't post topics, the following php error came up:
Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in ---------------------topic.php on line 5

This is line 5:
CODE
(c) 2001 - 2006 Invision Power Services, Inc. |    |

It is just the copyright so I don't see how that can go wrong

Can anyone shine some light on this?
Yippee
I'm assuming that this line is from a PHP file, and if it is this line should be commented out and thus the server should just completely ignore that line. Try just adding a // before that line and see if it makes any difference.

It could help to see the first 20 lines of that file or something like that to see if it commented out properly or not, but if adding the // works then forget it.
error404
ooh sorry, stupid notepad had to cut off EVERY line when it reached the end, the 5th line is this:
CODE
if ( $poll_data['t23_cop'] )
gabtdw
QUOTE (error404 @ Sep 8 2009, 06:16 AM) *
ooh sorry, stupid notepad had to cut off EVERY line when it reached the end, the 5th line is this:
CODE
if ( $poll_data['t23_cop'] )


That's just a line out of context, to get the bigger picture it would be helpful to see the first 10 lines in case the error is, in fact, on a different line.

Also I would recommend using Notepad++ - the syntax highlighting really helps for detecting syntax errors and the like smile.gif

It's possible that the error is on a different line, the PHP parser gets the line references wrong sometimes.
Yippee
QUOTE (Earlofvarrok @ Sep 8 2009, 05:19 AM) *
QUOTE (error404 @ Sep 8 2009, 06:16 AM) *
ooh sorry, stupid notepad had to cut off EVERY line when it reached the end, the 5th line is this:
CODE
if ( $poll_data['t23_cop'] )


That's just a line out of context, to get the bigger picture it would be helpful to see the first 10 lines in case the error is, in fact, on a different line.

Also I would recommend using Notepad++ - the syntax highlighting really helps for detecting syntax errors and the like smile.gif

It's possible that the error is on a different line, the PHP parser gets the line references wrong sometimes.

What he said. And if line 5 is part of a function, then the error could actually be on line 372 or something like that, but it doesn't affect anything until the function is called and line 5 is run. This is unlikely, usually the first few lines are not part of a function like that, but it's possible. Seeing the first 10 lines would probably enable us to solve your problem, but seeing the whole file would make it that much more likely.

Don't forget spoilers, lol.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.