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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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