Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/178288-solved-code-error-with-indexphp/
Share on other sites

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>';

  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!

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>

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?

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.

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.