Shiny_Charizard Posted December 29, 2007 Share Posted December 29, 2007 I get this error on my top.php : Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/tpfrpg/public_html/top.php on line 28 Here is my top.php file: <?php session_start(); $loggedin = false; // Check to see if we are logged in if(session_is_registered("username") && session_is_registered ("password")) { $loggedin = true; } ?> <HTML> <title>The Pokémon Flamez RPG - Version 0.1 </title> <HEAD> <link rel="stylesheet" href="style.css" type="text/css"> </HEAD> <body> <!-- Banner Start --> <center><TABLE BORDER="1"> <TD><a href="/index.php"> <img src="/images/bannerv01.png" border="0" alt="The Pokémon Flamez RPG" title="The Pokémon Flamez RPG"></a></TD> </TABLE> </center> <!-- Banner End --> <?PHP if($loggedin==false) { echo "<center> <TABLE BORDER=\"1"\ WIDTH=\"988"\ > <TD> <TABLE BORDER=\"1"\ RULES=\"rows"\ WIDTH=\"190px"\ ALIGN=\"center"\ > <TR> <TD CLASS=\"theadings"\ ><CENTER><B>General</B></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=/"index.php/"> Home </a></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href="\register.php"\ > Register </a></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=\"login.php"\ > Login </a></CENTER></TD> </TR> </TABLE> </TD>"; } else { echo "<center> <TABLE BORDER=\"1"\ WIDTH=\"988"\ > <TD> <TABLE BORDER=\"1"\ RULES=\"rows"\ WIDTH=\"190px"\ ALIGN=\"center"\ > <TR> <TD CLASS=\"theadings"\ ><CENTER><B>General</B></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=\"index.php"\ > Home </a></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\><CENTER><a href=\"stafflist.php"\ > Staff List </a></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=\"logout.php"\ > Log Out </a></CENTER></TD> </TR> <TR> <TD CLASS=\"theadings"\ ><CENTER><B>Users</B></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=\"profile.php"\ > My Profile </a></CENTER></TD> </TR> <TR> <TD CLASS=\"headings"\ ><CENTER><a href=\"viewprofiles.php"\ > View Members </a></CENTER></TD> </TABLE> </TD>"; ?> Can anyone please tell me what's wrong? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 29, 2007 Share Posted December 29, 2007 Why have you coded entirely on one line? Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 I didn't it just came out that way when I posted the code. Quote Link to comment Share on other sites More sharing options...
trq Posted December 29, 2007 Share Posted December 29, 2007 You'll need to format it in such a way that we can read it. Sorry. Quote Link to comment Share on other sites More sharing options...
papaface Posted December 29, 2007 Share Posted December 29, 2007 "<TABLE BORDER=/"1/" You have escaped the wrong way. Should be: "<TABLE BORDER=\"1\" Change that for the rest of your code. Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 Ok I will try it. EDIT: It didn't work, and I put the code right so it's not in one line anymore. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 29, 2007 Share Posted December 29, 2007 All of your escapes are the wrong way. Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 Sorry if this sounds nooby (if that' s even a word xD) what are escapes are they the /s, I'm still learning php so I'm not an expert. Quote Link to comment Share on other sites More sharing options...
trq Posted December 29, 2007 Share Posted December 29, 2007 Yes, to escape a char you use a backslash \ Yours are around the wrong way / (forward slash). Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 Oh, ok thanks let me try that. Edit: After I change it to backslashes it came up with 2 errors: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tpfrpg/public_html/top.php on line 27 Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/tpfrpg/public_html/top.php on line 27 Quote Link to comment Share on other sites More sharing options...
AndyB Posted December 29, 2007 Share Posted December 29, 2007 Please post the relevant code (at least the five or six lines before line 27 and identify line 27 for us). Of course, that assumes you've checked that all escaped characters are properly escaped, etc. Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 The last line is line 27: </TABLE> </center> <!-- Banner End --> <?php if($loggedin==false) { echo "<center> Quote Link to comment Share on other sites More sharing options...
jitesh Posted December 29, 2007 Share Posted December 29, 2007 <?php echo "<TABLE BORDER=\"1"\ WIDTH=\"988"\ > <TD> <TABLE BORDER=\"1"\ RULES=\"rows"\ WIDTH=\"190px"\ ALIGN=\"center"\ > <TR> <TD CLASS=\"theadings"\ ><CENTER><B>General</B></CENTER></TD> </TR> ............................................... ........................................................ ........................................................ ?> Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 Ok I did that now and it gives me a diffrent error: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tpfrpg/public_html/top.php on line 27 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/tpfrpg/public_html/top.php on line 27 Quote Link to comment Share on other sites More sharing options...
AndyB Posted December 29, 2007 Share Posted December 29, 2007 OK, please post all of the code - exactly as it exists on your server - up to and including line 27. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 29, 2007 Share Posted December 29, 2007 You have a large number of unescaped double quotes followed by escaped spaces: Stuff like <?php echo "<TABLE BORDER=\"1"\ WIDTH=\"988"\ > ?> should be <?php echo "<TABLE BORDER=\"1\" WIDTH=\"988\" > ?> Ken Quote Link to comment Share on other sites More sharing options...
Shiny_Charizard Posted December 29, 2007 Author Share Posted December 29, 2007 Nevermind, I just fixed it but thanks a lot for all your help. I just had to use single quotes instead of double quotes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.