g

syntex error 질문입니다.(초초보)

· 2008-02-09 (토) 10:08:01 · 2977 · 2

아래 소스를 실행해보니 다음과 같은 에러가 나는데 어디가 잘못되었는지 모르겠어요.
도와주세요. 소스는 "성공적인 웹 프로그래밍 PHP와MySQL"제3판의 소스입니다.

에러문구는
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\APM_Setup\htdocs\chapter6\page.inc on line 116

=================
아래 : page.inc 소스
=================

<?php
class Page
{
  // Page 클래스의 속성
  public $content;
  public $title = 'TLA Consulting Pty Ltd';
  public $keywords = 'TLA Consulting, Three Letter Abbreviation,
                   some of my best friends are search engines';
  public $buttons = array( 'Home'     => 'home.php',
                        'Contact'  => 'contact.php',
                        'Services' => 'services.php',
                        'Site Map' => 'map.php'
                      );

  // Page 클래스의 연산
  public function __set($name, $value)
  {
    $this->$name = $value;
  }

  public function Display()
  {
    echo "<html>\n<head>\n";
    $this -> DisplayTitle();
    $this -> DisplayKeywords();
    $this -> DisplayStyles();
    echo "</head>\n<body>\n";
    $this -> DisplayHeader();
    $this -> DisplayMenu($this->buttons);
    echo $this->content;
    $this -> DisplayFooter();
    echo "</body>\n</html>\n";
  }

  public function DisplayTitle()
  {
    echo '<title> '.$this->title.' </title>';
  }

  public function DisplayKeywords()
  {
    echo "<meta name=\"keywords\" content=\"".
         "htmlentities($this->keywords)\" />";
  }

  public function DisplayStyles()
  {
?>  
<!--
  <style>
    h1 {color:white; font-size:24pt; text-align:center;
        font-family:arial,sans-serif}
    .menu {color:white; font-size:12pt; text-align:center;
           font-family:arial,sans-serif; font-weight:bold}
    td {background:black}
    p {color:black; font-size:12pt; text-align:justify;
       font-family:arial,sans-serif}
    p.foot {color:white; font-size:9pt; text-align:center;
            font-family:arial,sans-serif; font-weight:bold}
    a:link,a:visited,a:active {color:white}
  </style>
-->
<?php
  }

  public function DisplayHeader()
  {
?>  
  <table width="100%" cellpadding ="12" cellspacing ="0" border ="0">
  <tr bgcolor ="black">
    <td align ="left"><img src = "logo.gif" /></td>
    <td>
        <h1>TLA Consulting Pty Ltd</h1>
    </td>
    <td align ="right"><img src = "logo.gif" /></td>
  </tr>
  </table>
<?php
  }

  public function DisplayMenu($buttons)
  {
    echo "<table width='100%' bgcolor='white' cellpadding='4'
                cellspacing='4'>\n";
    echo "  <tr>\n";

 //버튼의 크기를 계산한다.
    $width = 100/count($buttons);

    foreach ($buttons as $name=>$url)
    {
      $this -> DisplayButton($width, $name, $url, !$this->IsURLCurrentPage($url));
    }
    echo "  </tr>\n";
    echo "</table>\n";
  }

  public function IsURLCurrentPage($url)
  {
    if(strpos($_SERVER['PHP_SELF'], $url )==false)
    {
      return false;
    }
    else
    {
      return true;
    }
  }

  public function DisplayButton($width, $name, $url, $active = true)
  {
    if ($active)
    {
      echo "<td width ='".htmlentities($width)."%'>
            <a href ='".htmlentities($url)"'>
            <img src ='s-logo.gif' alt ='".htmlentities($name)"' border ='0' /></a>
            <a href ='$url'><span class='menu'>$name</span></a></td>";
    } 
    else
    {
      echo "<td width ='".htmlentities($width)"%'>
            <img src ='side-logo.gif'>
            <span class='menu'>$name</span></td>";
    } 
  }

  public function DisplayFooter()
  {
?>
    <table width = "100%" bgcolor ="black" cellpadding ="12" border ="0">
    <tr>
      <td>
        <p class="foot">© TLA Consulting Pty Ltd.</p>
        <p class="foot">Please see our
                      <a href ="legal.php">legal information page</a></p>
      </td>
    </tr>
    </table>
<?php
  }
}
?>

|

댓글 2개

2008-02-11 (월) 08:56:08
여기는 질문하는 게시판이 아닌듯합니다.

<img src ='s-logo.gif' alt ='".htmlentities($name)"' border ='0' /></a>
->
<img src ='s-logo.gif' alt ='".htmlentities($name)."' border ='0' /></a>
이렇게 해주시면 되겠네요
2008-02-14 (목) 09:10:48
본 게시물은 질문게시판으로 이동되었습니다..
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
11-08-16 조회 2,398
11-08-16 조회 2,378
11-08-12 조회 2,213
11-08-02 조회 2,795
11-07-27 조회 2,182
11-07-25 조회 2,312
11-06-28 조회 2,471
11-06-06 조회 3,963
11-06-04 조회 2,573
11-04-25 조회 6,159
11-04-22 조회 2,660
11-04-21 조회 2,863
11-04-08 조회 3,217
11-03-31 조회 2,804
11-03-20 조회 3,215
11-03-10 조회 2,849
11-03-04 조회 3,173
11-03-03 조회 2,898
11-02-26 조회 4,320
11-02-14 조회 5,674
11-02-08 조회 3,282
11-01-30 조회 5,359
11-01-14 조회 5,138
11-01-14 조회 3,717
11-01-14 조회 2,877
11-01-14 조회 2,914
11-01-14 조회 3,061
11-01-12 조회 2,794
11-01-07 조회 4,493
10-12-29 조회 2,415
10-12-22 조회 2,464
10-12-05 조회 5,792
10-11-22 조회 5,211
10-11-13 조회 3,584
10-10-27 조회 3,203
10-10-21 조회 2,902
10-09-21 조회 2,906
10-09-17 조회 2,947
10-09-15 조회 3,396
10-09-14 조회 4,004
10-05-18 조회 2,873
10-02-17 조회 4,309
10-02-12 조회 3,081
09-12-14 조회 5,095
09-12-14 조회 6,003
09-09-19 조회 4,378
09-08-16 조회 6,219
09-07-22 조회 5,629
09-04-13 조회 3,040
09-03-15 조회 5,042
09-03-05 조회 3,872
09-02-09 조회 2,820
08-12-30 조회 3,012
08-12-06 조회 3,216
08-11-30 조회 3,558
08-10-18 조회 4,393
08-10-08 조회 3,695
08-09-19 조회 4,336
08-09-05 조회 2,977
08-09-05 조회 5,086
08-09-05 조회 2,966
08-09-05 조회 3,554
08-09-05 조회 3,473
08-09-01 조회 4,493
08-08-07 조회 2,747
08-06-08 조회 3,218
08-06-02 조회 2,809
08-05-26 조회 5,234
08-05-09 조회 4,300
08-04-22 조회 3,888
08-04-17 조회 4,477
08-04-17 조회 5,555
08-04-17 조회 3,687
08-04-17 조회 8,675
08-04-17 조회 4,567
08-04-17 조회 4,487
08-04-09 조회 3,047
08-03-31 조회 3,544
08-03-26 조회 3,237
08-03-25 조회 3,529
08-03-25 조회 3,957
08-03-25 조회 4,004
08-03-25 조회 3,663
08-03-25 조회 3,555
08-03-25 조회 3,556
08-03-25 조회 5,245
08-02-03 조회 5,236
08-01-18 조회 6,614
08-01-17 조회 3,914
08-01-17 조회 3,734
08-01-12 조회 4,019
08-01-08 조회 3,343
07-12-28 조회 4,615
07-12-04 조회 3,488
07-11-30 조회 5,099
07-11-30 조회 5,714
07-11-02 조회 4,009
07-10-24 조회 3,987
07-10-24 조회 3,265
07-10-24 조회 3,371