suttercain Posted February 21, 2007 Share Posted February 21, 2007 Hello, Here is the code: <?php class HtmlGenerator { public function __construct($in_pageTitle) { // spit out page headers: echo <<<EOHEAD <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> $in_pageTitle </title> </head> <body> EOHEAD; } public function closePage() { echo <<<EOPAGE </body> </html> EOPAGE; } public function emitTopMenuBar($in_highLightThisMenuItem) { // the top menu bar is in a table... echo <<<TOPMENU <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <!-- etc. contents of top menu bar are here ... --> </tr> </table> TOPMENU; } public function openPageBody() { // start the table that will host the body of the page // and the ad bar echo <<<BODYOPEN <table width='100%' border='0' cellspacing='0'> <tr> BODYOPEN; } public function closePageBody() { // close off the table for the page body. echo <<<EOBODY </tr> </table> EOBODY; } public function emitLeftAdBar() { // the ad bar will be a 125-pixel column along the left echo <<<ADBAR <td width='125' valign='top'> <table width='100%' border='0' cellspacing='0'> <tr> <!-- left menu bar body goes here ... --> </tr> </td> ADBAR; } public function openPageContent() { // this opens up the main block for putting in the // content of this page. echo <<<EOCONTENT <td valign='top'> EOCONTENT; } public function closePageContent() { // close off content column. echo <<<EOCONTENT </td> EOCONTENT: } public function emitCopyrightBar() { echo <<<COPYRIGHT <!-- emit the copyright info across the bottom here. --> COPYRIGHT; } } ?> Here is the error: Parse error: parse error, unexpected $end in D:\wamp\www\PHP Tutorials\title.php on line 109 I checked al the brackets and all the closing statements. What did I overlook? Thanks everyone. Shannon Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/ Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 EOCONTENT: needs to be EOCONTENT; Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/#findComment-190191 Share on other sites More sharing options...
kenrbnsn Posted February 21, 2007 Share Posted February 21, 2007 I know you marked this "solved", but why are you using three lines of code: <?php echo <<<EOCONTENT </td> EOCONTENT; ?> when one will do? <?php echo '</td>'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/#findComment-190239 Share on other sites More sharing options...
suttercain Posted February 22, 2007 Author Share Posted February 22, 2007 Hi Ken, I'm not sure. Most of the code I post here are from books. I am a newbie and am trying to learn. Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/#findComment-191404 Share on other sites More sharing options...
kenrbnsn Posted February 22, 2007 Share Posted February 22, 2007 Don't trust the code in many of the books, quite a few of the examples are full of errors. I learned by trail and error, reading the manual at www.php.net, and reading many forums. Posting your questions here is a good way to learn, since most of the people who respond know what they're talking about. Ken Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/#findComment-191429 Share on other sites More sharing options...
suttercain Posted February 22, 2007 Author Share Posted February 22, 2007 How long did it take you to learn. I mean when you really had PHP down? How much time a day did you spend reading and trying out code? Thanks. Shannon Link to comment https://forums.phpfreaks.com/topic/39419-solved-again-with-the-parse-error/#findComment-191466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.