아래 소스를 실행해보니 다음과 같은 에러가 나는데 어디가 잘못되었는지 모르겠어요.
도와주세요. 소스는 "성공적인 웹 프로그래밍 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개
<img src ='s-logo.gif' alt ='".htmlentities($name)"' border ='0' /></a>
->
<img src ='s-logo.gif' alt ='".htmlentities($name)."' border ='0' /></a>
이렇게 해주시면 되겠네요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 460 | ||
| 7929 | 9년 전 | 396 | ||
| 7928 | 9년 전 | 472 | ||
| 7927 | 9년 전 | 379 | ||
| 7926 | 9년 전 | 689 | ||
| 7925 | 9년 전 | 408 | ||
| 7924 | 9년 전 | 390 | ||
| 7923 | 9년 전 | 380 | ||
| 7922 | 9년 전 | 414 | ||
| 7921 | 9년 전 | 433 | ||
| 7920 | 9년 전 | 343 | ||
| 7919 | 9년 전 | 353 | ||
| 7918 | 9년 전 | 507 | ||
| 7917 | 9년 전 | 359 | ||
| 7916 | 9년 전 | 446 | ||
| 7915 | 9년 전 | 454 | ||
| 7914 | 9년 전 | 468 | ||
| 7913 | 9년 전 | 641 | ||
| 7912 | 9년 전 | 469 | ||
| 7911 | 9년 전 | 398 | ||
| 7910 | 9년 전 | 448 | ||
| 7909 | 9년 전 | 556 | ||
| 7908 | 9년 전 | 494 | ||
| 7907 | 9년 전 | 430 | ||
| 7906 | 9년 전 | 449 | ||
| 7905 | 9년 전 | 423 | ||
| 7904 | 9년 전 | 409 | ||
| 7903 | 9년 전 | 407 | ||
| 7902 | 9년 전 | 593 | ||
| 7901 |
|
9년 전 | 767 | |
| 7900 | 9년 전 | 650 | ||
| 7899 | 9년 전 | 432 | ||
| 7898 | 9년 전 | 431 | ||
| 7897 | 9년 전 | 391 | ||
| 7896 | 9년 전 | 408 | ||
| 7895 | 9년 전 | 523 | ||
| 7894 | 9년 전 | 435 | ||
| 7893 | 9년 전 | 410 | ||
| 7892 | 9년 전 | 450 | ||
| 7891 | 9년 전 | 808 | ||
| 7890 | 9년 전 | 1231 | ||
| 7889 | 9년 전 | 766 | ||
| 7888 |
limsy1987
|
9년 전 | 578 | |
| 7887 | 9년 전 | 615 | ||
| 7886 | 9년 전 | 504 | ||
| 7885 | 9년 전 | 473 | ||
| 7884 | 9년 전 | 465 | ||
| 7883 | 9년 전 | 473 | ||
| 7882 | 9년 전 | 529 | ||
| 7881 | 9년 전 | 502 | ||
| 7880 | 9년 전 | 623 | ||
| 7879 | 9년 전 | 513 | ||
| 7878 | 9년 전 | 1279 | ||
| 7877 | 9년 전 | 811 | ||
| 7876 | 9년 전 | 553 | ||
| 7875 | 9년 전 | 617 | ||
| 7874 |
|
9년 전 | 830 | |
| 7873 | 9년 전 | 552 | ||
| 7872 | 9년 전 | 719 | ||
| 7871 | 9년 전 | 531 | ||
| 7870 | 9년 전 | 649 | ||
| 7869 | 9년 전 | 472 | ||
| 7868 | 9년 전 | 508 | ||
| 7867 | 9년 전 | 507 | ||
| 7866 | 9년 전 | 569 | ||
| 7865 | 9년 전 | 510 | ||
| 7864 | 9년 전 | 571 | ||
| 7863 | 9년 전 | 565 | ||
| 7862 | 9년 전 | 524 | ||
| 7861 | 9년 전 | 694 | ||
| 7860 | 9년 전 | 670 | ||
| 7859 | 9년 전 | 446 | ||
| 7858 | 9년 전 | 758 | ||
| 7857 | 9년 전 | 1142 | ||
| 7856 | 9년 전 | 571 | ||
| 7855 | 9년 전 | 805 | ||
| 7854 | 9년 전 | 754 | ||
| 7853 | 9년 전 | 650 | ||
| 7852 | 9년 전 | 567 | ||
| 7851 | 9년 전 | 563 | ||
| 7850 | 9년 전 | 637 | ||
| 7849 | 9년 전 | 406 | ||
| 7848 | 9년 전 | 470 | ||
| 7847 | 9년 전 | 718 | ||
| 7846 | 9년 전 | 501 | ||
| 7845 | 9년 전 | 470 | ||
| 7844 | 9년 전 | 440 | ||
| 7843 | 9년 전 | 483 | ||
| 7842 | 9년 전 | 464 | ||
| 7841 | 10년 전 | 430 | ||
| 7840 | 10년 전 | 447 | ||
| 7839 | 10년 전 | 493 | ||
| 7838 | 10년 전 | 555 | ||
| 7837 | 10년 전 | 385 | ||
| 7836 | 10년 전 | 444 | ||
| 7835 | 10년 전 | 523 | ||
| 7834 |
|
10년 전 | 1228 | |
| 7833 | 10년 전 | 490 | ||
| 7832 | 10년 전 | 463 | ||
| 7831 | 10년 전 | 626 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기