MySQL_Narb Posted October 19, 2009 Share Posted October 19, 2009 Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_html/index.php on line 25 <html> <head> <title>CrazyQuest - The online website for quests!</title> </head> <body> <center> <div id="container" > <div id="banner" > <a href="http://www.intensivstation.ch"><img src="Images/logo.png" alt="" width="414" height="56" border="0" /></a> <h1>CrazyQuest</h1> </div> <div id="content"> <?php if ($_SESSION['loggedin']) { echo 'Welcome'; echo $_SESSION['loggedin']; } else { echo '<h3>What is crazyQuest?</h3> <p>CrazyQuest is a brand new online website that allows you to test your knowledge! These quests won't all be kitty, some of these quests may contain violence. But nothing bad! We believe that all our members should have fun! So, we make fun short and long quests for members to earn points.</p> <h3>Beta</h3> <p>If you signup for our beta, you'll gain an extra 100 points that you can use in our shops! So if you want some cool prizes, we suggest you register today! Also, Beta accounts will have access to a special area that no other people can get into after the open beta. Beta members will also receive a crown by their name on the highscores.</p><br /><br /> <h3>Signup</h3> <p>You can signup here: <a href="register.php">Register</a></p> </div>; ?> <div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div> </center> </body> Quote Link to comment Share on other sites More sharing options...
Alex Posted October 19, 2009 Share Posted October 19, 2009 First off you're not even closing the echo with a closing ('), second off you must escape all additional single-quotes inside of the string. So: echo '<h3>What is crazyQuest?</h3> <p>CrazyQuest is a brand new online website that allows you to test your knowledge! These quests won\'t all be kitty, some of these quests may contain violence. But nothing bad! We believe that all our members should have fun! So, we make fun short and long quests for members to earn points.</p> <h3>Beta</h3> <p>If you signup for our beta, youll gain an extra 100 points that you can use in our shops! So if you want some cool prizes, we suggest you register today! Also, Beta accounts will have access to a special area that no other people can get into after the open beta. Beta members will also receive a crown by their name on the highscores.</p><br /><br /> <h3>Signup</h3> <p>You can signup here: <a href="register.php">Register</a></p> </div>'; Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 19, 2009 Share Posted October 19, 2009 else { echo '<h3>What is crazyQuest?</h3> <p>CrazyQuest is a brand new online website that allows you to test your knowledge! These quests won't all be kitty, some of these quests may contain violence. But nothing bad! We believe that all our members should have fun! So, we make fun short and long quests for members to earn points.</p> <h3>Beta</h3> <p>If you signup for our beta, youll gain an extra 100 points that you can use in our shops! So if you want some cool prizes, we suggest you register today! Also, Beta accounts will have access to a special area that no other people can get into after the open beta. Beta members will also receive a crown by their name on the highscores.</p><br /><br /> <h3>Signup</h3> <p>You can signup here: <a href="register.php">Register</a></p> </div>; ?> You haven't closed the else block (not } ) also you need to escape the single quotes won't should be won\'t oooookay.. looks like AlexWD beat me again! Quote Link to comment Share on other sites More sharing options...
MySQL_Narb Posted October 19, 2009 Author Share Posted October 19, 2009 Parse error: syntax error, unexpected '>' in /home/runevid/public_html/index.php on line 24 <html> <head> <title>CrazyQuest - The online website for quests!</title> </head> <body> <center> <div id="container" > <div id="banner" > <a href="http://www.intensivstation.ch"><img src="Images/logo.png" alt="" width="414" height="56" border="0" /></a> <h1>CrazyQuest</h1> </div> <div id="content"> <?php if ($_SESSION['loggedin']) { echo 'Welcome'; echo $_SESSION['loggedin']; } else { echo '<h3>What is crazyQuest?</h3> <p>CrazyQuest is a brand new online website that allows you to test your knowledge! These quests won\'t all be kitty, some of these quests may contain violence. But nothing bad! We believe that all our members should have fun! So, we make fun short and long quests for members to earn points.</p> <h3>Beta</h3> <p>If you signup for our beta, youll gain an extra 100 points that you can use in our shops! So if you want some cool prizes, we suggest you register today! Also, Beta accounts will have access to a special area that no other people can get into after the open beta. Beta members will also receive a crown by their name on the highscores.</p><br /><br /> <h3>Signup</h3> <p>You can signup here: <a href="register.php">Register</a></p> </div>'; <div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div> </center> </body> Quote Link to comment Share on other sites More sharing options...
Alex Posted October 19, 2009 Share Posted October 19, 2009 You're not closing the else statement's opening { with } (As MadTechie said), additionally you're not closing <?php with ?>, so PHP is trying to interpret your HTML. Quote Link to comment Share on other sites More sharing options...
MySQL_Narb Posted October 19, 2009 Author Share Posted October 19, 2009 You're not closing the else statement's opening { with } (As MadTechie said), additionally you're not closing <?php with ?>, so PHP is trying to interpret your HTML. Yes my else statement is opening...and closing. And what do you mean by Interpreting my HTML? Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted October 19, 2009 Share Posted October 19, 2009 and closing.i don't see a closing } Quote Link to comment Share on other sites More sharing options...
Alex Posted October 19, 2009 Share Posted October 19, 2009 I don't see a closing } bracket..? Are you not posting the full code. And here's what I was talking about: <div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div> ... That's not PHP, so it shouldn't be read as PHP, right? Make sure you place ?> before it, so it knows where to stop. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 19, 2009 Share Posted October 19, 2009 You need to close the PHP block with ?> IE <div id="content"> <?php if ($_SESSION['loggedin']) { echo 'Welcome'; echo $_SESSION['loggedin']; } else { echo '<h3>What is crazyQuest?</h3> <p>CrazyQuest is a brand new online website that allows you to test your knowledge! These quests won\'t all be kitty, some of these quests may contain violence. But nothing bad! We believe that all our members should have fun! So, we make fun short and long quests for members to earn points.</p> <h3>Beta</h3> <p>If you signup for our beta, youll gain an extra 100 points that you can use in our shops! So if you want some cool prizes, we suggest you register today! Also, Beta accounts will have access to a special area that no other people can get into after the open beta. Beta members will also receive a crown by their name on the highscores.</p><br /><br /> <h3>Signup</h3> <p>You can signup here: <a href="register.php">Register</a></p> </div>'; } //close if //close PHP ?> <div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div> Quote Link to comment Share on other sites More sharing options...
MySQL_Narb Posted October 19, 2009 Author Share Posted October 19, 2009 Sorry guys, I appreciate the help! Thanks to you guys I got it. I didn't see that I needed a } at the end, I can't believe I missed it. 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.