asucrews Posted August 21, 2008 Share Posted August 21, 2008 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> Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/ Share on other sites More sharing options...
adam291086 Posted August 21, 2008 Share Posted August 21, 2008 sometimes means you hav missed a bracket of the end of an if statement ect Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622488 Share on other sites More sharing options...
genericnumber1 Posted August 21, 2008 Share Posted August 21, 2008 you typo'd your _HEADER_ at the end of your heredoc statement Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622494 Share on other sites More sharing options...
asucrews Posted August 21, 2008 Author Share Posted August 21, 2008 yep sure doe :-\ but i still getting a error. Parse error: syntax error, unexpected $end in /home/content/j/m/c/jmcrews/html/newassite/debug.php on line 62 so is there anything else Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622501 Share on other sites More sharing options...
PFMaBiSmAd Posted August 21, 2008 Share Posted August 21, 2008 Heredoc end tags must begin in first column (they cannot be indented.) Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622505 Share on other sites More sharing options...
genericnumber1 Posted August 21, 2008 Share Posted August 21, 2008 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> Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622507 Share on other sites More sharing options...
asucrews Posted August 21, 2008 Author Share Posted August 21, 2008 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); ?> Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622529 Share on other sites More sharing options...
asucrews Posted August 21, 2008 Author Share Posted August 21, 2008 well, thanks for all the help!!!!!!!!!!!!!!!!!! i got it working now Link to comment https://forums.phpfreaks.com/topic/120771-parse-error-syntax-error-unexpected-end-online-61/#findComment-622576 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.