Jump to content

[SOLVED] Again With The Parse Error...


suttercain

Recommended Posts

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

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

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.