아래 소스를 실행해보니 다음과 같은 에러가 나는데 어디가 잘못되었는지 모르겠어요.
도와주세요. 소스는 "성공적인 웹 프로그래밍 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>
이렇게 해주시면 되겠네요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 167 | ||
| 8229 | 9년 전 | 142 | ||
| 8228 |
커네드커네드
|
9년 전 | 187 | |
| 8227 | 9년 전 | 230 | ||
| 8226 | 9년 전 | 243 | ||
| 8225 | 9년 전 | 225 | ||
| 8224 | 9년 전 | 233 | ||
| 8223 | 9년 전 | 213 | ||
| 8222 |
|
9년 전 | 274 | |
| 8221 | 9년 전 | 173 | ||
| 8220 | 9년 전 | 211 | ||
| 8219 | 9년 전 | 184 | ||
| 8218 | 9년 전 | 233 | ||
| 8217 |
star3840
|
9년 전 | 198 | |
| 8216 | 9년 전 | 265 | ||
| 8215 | 9년 전 | 208 | ||
| 8214 | 9년 전 | 325 | ||
| 8213 | 9년 전 | 279 | ||
| 8212 | 9년 전 | 184 | ||
| 8211 | 9년 전 | 358 | ||
| 8210 | 9년 전 | 358 | ||
| 8209 | 9년 전 | 435 | ||
| 8208 | 9년 전 | 324 | ||
| 8207 | 9년 전 | 332 | ||
| 8206 |
|
9년 전 | 279 | |
| 8205 | 9년 전 | 251 | ||
| 8204 | 9년 전 | 242 | ||
| 8203 | 9년 전 | 318 | ||
| 8202 | 9년 전 | 234 | ||
| 8201 | 9년 전 | 263 | ||
| 8200 | 9년 전 | 277 | ||
| 8199 | 9년 전 | 303 | ||
| 8198 | 9년 전 | 262 | ||
| 8197 | 9년 전 | 249 | ||
| 8196 | 9년 전 | 671 | ||
| 8195 | 9년 전 | 262 | ||
| 8194 | 9년 전 | 371 | ||
| 8193 | 9년 전 | 277 | ||
| 8192 | 9년 전 | 292 | ||
| 8191 | 9년 전 | 249 | ||
| 8190 | 9년 전 | 230 | ||
| 8189 | 9년 전 | 296 | ||
| 8188 | 9년 전 | 224 | ||
| 8187 | 9년 전 | 238 | ||
| 8186 | 9년 전 | 231 | ||
| 8185 | 9년 전 | 405 | ||
| 8184 | 9년 전 | 190 | ||
| 8183 | 9년 전 | 401 | ||
| 8182 | 9년 전 | 271 | ||
| 8181 | 9년 전 | 228 | ||
| 8180 | 9년 전 | 795 | ||
| 8179 | 9년 전 | 570 | ||
| 8178 | 9년 전 | 436 | ||
| 8177 |
kiplayer
|
9년 전 | 432 | |
| 8176 | 9년 전 | 459 | ||
| 8175 | 9년 전 | 353 | ||
| 8174 | 9년 전 | 342 | ||
| 8173 | 9년 전 | 432 | ||
| 8172 | 9년 전 | 308 | ||
| 8171 | 9년 전 | 274 | ||
| 8170 | 9년 전 | 389 | ||
| 8169 |
커네드커네드
|
9년 전 | 346 | |
| 8168 | 9년 전 | 425 | ||
| 8167 | 9년 전 | 414 | ||
| 8166 | 9년 전 | 315 | ||
| 8165 | 9년 전 | 260 | ||
| 8164 | 9년 전 | 394 | ||
| 8163 | 9년 전 | 398 | ||
| 8162 | 9년 전 | 384 | ||
| 8161 | 9년 전 | 399 | ||
| 8160 |
|
9년 전 | 619 | |
| 8159 | 9년 전 | 559 | ||
| 8158 | 9년 전 | 354 | ||
| 8157 | 9년 전 | 470 | ||
| 8156 | 9년 전 | 348 | ||
| 8155 | 9년 전 | 353 | ||
| 8154 |
00년생용띠
|
9년 전 | 685 | |
| 8153 | 9년 전 | 320 | ||
| 8152 |
|
9년 전 | 503 | |
| 8151 | 9년 전 | 501 | ||
| 8150 | 9년 전 | 613 | ||
| 8149 |
Jangfolk
|
9년 전 | 470 | |
| 8148 | 9년 전 | 283 | ||
| 8147 | 9년 전 | 465 | ||
| 8146 | 9년 전 | 552 | ||
| 8145 | 9년 전 | 507 | ||
| 8144 | 9년 전 | 476 | ||
| 8143 | 9년 전 | 306 | ||
| 8142 | 9년 전 | 518 | ||
| 8141 | 9년 전 | 459 | ||
| 8140 | 9년 전 | 1026 | ||
| 8139 | 9년 전 | 377 | ||
| 8138 |
전갈자리남자
|
9년 전 | 478 | |
| 8137 | 9년 전 | 517 | ||
| 8136 | 9년 전 | 845 | ||
| 8135 |
|
9년 전 | 885 | |
| 8134 |
PlayPixel
|
9년 전 | 625 | |
| 8133 |
|
9년 전 | 532 | |
| 8132 | 9년 전 | 570 | ||
| 8131 | 9년 전 | 929 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기