Jump to content

Parse error: syntax error, unexpected $end online 61


asucrews

Recommended Posts

hello everyone, just got in to php/mysql work and i getting a error i can't find.  is telling me about 61 but there only 59 lines in my code  :-\

 

<?php

$usr = "removed";
$pwd = "removed";
$dbname = "removed";
$dbhost = "removed";
$conn = mysql_connect("$dbhost","$usr","$pwd"); 
mysql_select_db($dbname) or die(mysql_error()); 
$logged = MYSQL_QUERY("SELECT * FROM `members` WHERE `id` = '$_SESSION[id]' AND `password` = '$_SESSION[password]'"); 
$logged = mysql_fetch_array($logged); 
//some server details, don't edit!
$host = $_SERVER['HTTP_HOST'];
$self = $_SERVER['PHP_SELF'];
//change this to your site name
$sitename = "AtenSteward";
//Send emails or not (email activation). 1 = true, 0 = false
$semail = "1";

$result = mysql_query("SELECT * FROM pages WHERE id = '$pageid'");
if (!$result) {
    die("Could not run query: " . mysql_error());
}
$row = mysql_fetch_row($result);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

  <meta name="description" content="We are meant to help those that are new to the challenge of being an Event Steward find the information needed to run an event according to the Society and Kingdom laws." />

  <meta name="keywords" content="sca barony,barony,sca information,sca society,sca work,kingdoms sca,kingdoms,sca child,sca minors, minors,sca research,resarch,sca analysis,sca career,sca,sca quote, atenveldt,society for creative anachronism, kingdom of atenveldt,sca war, sca camping, sca events,events,seneschal,renaissance, medieval,creative events, camping,  feasts, Crown Tournaments,Coronations,A&S Collegiums,A&S Competitions,Demonstrations,  Archery, sac archery,Insurance, sca Insurance,Publicity and Southwind Articles,southwind, publicity, sca publications,Royalty and Courts, sca Royalty and Courts,Media Involvement,Volunteers,sca Volunteers,sca Non-Profit Status,Non-Profit Status,Fund Raising,Stewards, autocrats,event stewards,event autocrats,Atenveldt,Tir Ysgithr,Sun Dragon,Mons Tonitrus,Twin Moons,Ered Sul,Burning Sands,March,Wealhhnutu,college,shireBrymstone,Saint Felix,Granite Mountain,Iron Wood Loch,Windale,Granholme,Sankt Vladimir " />

  <meta name="author" content="Selina,Willum,Fearghus,Phillpos / Original design by Andreas Viklund - 
http://andreasviklund.com/" />

<title><?php echo $row[1]; ?></title>
<link rel="stylesheet" type="text/css" href="layout.css" />
</head>
<body>
<div id="wrap">
	<div id="header">
<?php
if($pageid ='1'){print <<<_HEADER_
<p id="toplinks">Skip to: <a href="<?php echo $row[4]; ?>"><?php echo $row[3]; ?></a>
| <a href="<?php echo $row[6]; ?>"><?php echo $row[5]; ?></a></p>
<h1><a name="<?php echo $row[10]; ?>"></a><?php echo $row[9]; ?></h1>
<p><strong><a href="<?php echo $row[12]; ?>"><?php echo $row[11]; ?></a></strong></p>
_HEADER_;}else{
print <<<_HEADER_
<p id="toplinks">Skip to: <a href="<?php echo $row[4]; ?>"><?php echo $row[3]; ?></a>
| <a href="<?php echo $row[6]; ?>"><?php echo $row[5]; ?></a> | <a href="<?php echo $row[8]; ?>"><?php echo $row[7]; ?></a> </p>
<h1><a name="<?php echo $row[10]; ?>"></a><?php echo $row[9]; ?></h1>
<p><strong><a href="<?php echo $row[12]; ?>"><?php echo $row[11]; ?></a></strong></p>
_HEAFDER_;
}?>			
</div>

Yes, one drawback of the heredoc syntax is how sensitive its ending line is, it must have no left padding, and end on its very own line... you'll need to move down the else statement.

 

try this...

 

<?php
if($pageid ='1'){print <<<_HEADER_
<p id="toplinks">Skip to: <a href="<?php echo $row[4]; ?>"><?php echo $row[3]; ?></a>
| <a href="<?php echo $row[6]; ?>"><?php echo $row[5]; ?></a></p>
<h1><a name="<?php echo $row[10]; ?>"></a><?php echo $row[9]; ?></h1>
<p><strong><a href="<?php echo $row[12]; ?>"><?php echo $row[11]; ?></a></strong></p>
_HEADER_;
}else{
print <<<_HEADER_
<p id="toplinks">Skip to: <a href="<?php echo $row[4]; ?>"><?php echo $row[3]; ?></a>
| <a href="<?php echo $row[6]; ?>"><?php echo $row[5]; ?></a> | <a href="<?php echo $row[8]; ?>"><?php echo $row[7]; ?></a> </p>
<h1><a name="<?php echo $row[10]; ?>"></a><?php echo $row[9]; ?></h1>
<p><strong><a href="<?php echo $row[12]; ?>"><?php echo $row[11]; ?></a></strong></p>
_HEADER_;
}?>			
</div>

cool thanks!!!!

 

it works now but how it doesn't display the data for my datebase :(

 

http://ntinternationalinsurance.com/newassite/index.php

 

any ideas what make this happen? i am using the fellowing to pull form the database.

 

$result = mysql_query("SELECT * FROM pages WHERE id = '$pageid'");
if (!$result) {
    die("Could not run query: " . mysql_error());
}
$row = mysql_fetch_row($result);
?>

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.