Jump to content

Strange error on </html> line


slj90

Recommended Posts

Hi guys,

 

I'm getting an error directed at the last line of code on my page,

 

'</html>'

 

Parse error: syntax error, unexpected $end in /loggedon.php on line 108

 

Any ideas what this could be?

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php

session_start();

// Check if we have an authenticated user
if (!isset($_SESSION["authenticatedUser"]))
//if not re-direct to login page
{
$_SESSION["message"] = "Please Login";
header("Location: login.php");
}
else
{ 
//If authenticated then display page conetents
?>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>DRINKS2NITE</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="logo">
  <h1><DRINKS2NITE</h1>
	<p><em> 24 HOUR ALCOHOL DELIVERY</em></p></div>
<hr />
<div id="header">
	<div id="menu">
		<ul>
			<li><a href="#" class="first">SHOP</a></li>
			<li class="current_page_item"><a href="#">CHECKOUT</a></li>
			<li><a href="#">YOUR DETAILS</a></li>
			<li><a href="#">LOG OUT</a></li>
			<li></li>
			<li></li>
		</ul>
	</div>
	<div id="search">
		<form method="get" action="">
			<fieldset>
			<input type="text" name="s" id="search-text" size="15" />
			<input type="submit" id="search-submit" value="GO" />
			</fieldset>
		</form>
	</div>
</div>
<div id="page">
<div id="page-bgtop">
	<div id="content">
		<div class="post">
		  <div class="entry">
              <cener>
	    <p><center>
	      <br />
	      </p>
	    <table width="200" border="0" cellspacing="5" cellpadding="5">
	      <tr>
	        <td><img src="./images/beer.PNG" alt="Beer" /><br />
            Beer</td>
	        <td><img src="./images/spirits.PNG" alt="Spirits" /><br />
            Spirits</td>
	        <td><img src="./images/wine.PNG" alt="Wine" /><br />
	          Wine</td>
          </tr>
	      <tr>
	        <td><img src="./images/champ.PNG" alt="Champagne" /><br />
	          Champagne</td>
	        <td><img src="./images/mix.PNG" alt="Mixers" /><br />
            Mixers</td>
	        <td><img src="./images/extras.PNG" alt="Extras" /><br />
	          Spirits</td>
          </tr>
	      </table>
	    <p><br />
	      <br />
	      <br />
	    </p>
              </div>
		</div>
		<div class="post">
		  <div class="entry"> </div>
		</div>
	</div>
	<div id="sidebar">
		<ul>
			<li>
				<h2>YOUR CART</h2>
				<p><?php echo $_SESSION["authenticatedUser"] ?></p>
			</li>
		</ul>
  </div>
	<div style="clear: both;"> </div>
</div>
</div>
<div id="footer">
	<p>21281</p>
</div>
</div>
</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/188856-strange-error-on-line/
Share on other sites

From what I can see,

<?php echo $_SESSION["authenticatedUser"] ?>
You're missing a semi-colon,  as it parses all in one 'precedure' it is required, try to add it and see if it works..

 

EDIT:

else
{ 
//If authenticated then display page conetents

 

You're never ending your else tag!

Thanks for the reply..

 

Where am I missing the semi-colon? And how do I sort my else tag out?

 

Thank you for being patient with me  :)

 

You open an ELSE tag to display the html, but never end it. Just place what Buddski provided at the end of your script, The semicolon should go after the php code I quoted, before the ending tag.

 

As well, session_start() is placed incorrectly, you should keep it at top BEFORE you output any html.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.