아래 소스를 실행해보니 다음과 같은 에러가 나는데 어디가 잘못되었는지 모르겠어요.
도와주세요. 소스는 "성공적인 웹 프로그래밍 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>
이렇게 해주시면 되겠네요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 230 | 20년 전 | 2038 | ||
| 229 | 20년 전 | 3131 | ||
| 228 | 20년 전 | 3322 | ||
| 227 | 20년 전 | 2383 | ||
| 226 | 20년 전 | 5458 | ||
| 225 | 20년 전 | 2507 | ||
| 224 | 20년 전 | 2951 | ||
| 223 | 20년 전 | 4196 | ||
| 222 | 20년 전 | 2595 | ||
| 221 | 20년 전 | 2277 | ||
| 220 | 20년 전 | 3665 | ||
| 219 | 20년 전 | 2063 | ||
| 218 | 20년 전 | 3552 | ||
| 217 | 20년 전 | 2469 | ||
| 216 | 20년 전 | 2896 | ||
| 215 | 20년 전 | 2205 | ||
| 214 | 20년 전 | 3324 | ||
| 213 | 20년 전 | 2909 | ||
| 212 | 20년 전 | 3040 | ||
| 211 | 20년 전 | 2137 | ||
| 210 | 20년 전 | 1869 | ||
| 209 | 20년 전 | 2333 | ||
| 208 | 20년 전 | 1961 | ||
| 207 | 20년 전 | 1665 | ||
| 206 | 20년 전 | 1848 | ||
| 205 | 20년 전 | 3938 | ||
| 204 | 20년 전 | 1668 | ||
| 203 | 20년 전 | 2000 | ||
| 202 | 20년 전 | 2342 | ||
| 201 | 20년 전 | 1814 | ||
| 200 | 20년 전 | 2942 | ||
| 199 | 20년 전 | 1997 | ||
| 198 | 20년 전 | 2077 | ||
| 197 | 20년 전 | 3641 | ||
| 196 | 20년 전 | 2964 | ||
| 195 | 20년 전 | 2084 | ||
| 194 | 20년 전 | 10227 | ||
| 193 | 20년 전 | 2235 | ||
| 192 | 20년 전 | 1580 | ||
| 191 | 20년 전 | 2650 | ||
| 190 | 20년 전 | 2281 | ||
| 189 | 20년 전 | 1671 | ||
| 188 | 20년 전 | 1464 | ||
| 187 | 20년 전 | 1894 | ||
| 186 | 20년 전 | 1693 | ||
| 185 | 20년 전 | 1728 | ||
| 184 | 20년 전 | 2326 | ||
| 183 | 20년 전 | 1538 | ||
| 182 | 20년 전 | 1473 | ||
| 181 | 20년 전 | 1612 | ||
| 180 | 20년 전 | 2708 | ||
| 179 | 20년 전 | 1786 | ||
| 178 | 20년 전 | 1841 | ||
| 177 | 20년 전 | 1967 | ||
| 176 | 20년 전 | 1791 | ||
| 175 | 20년 전 | 1863 | ||
| 174 | 20년 전 | 1685 | ||
| 173 | 20년 전 | 2053 | ||
| 172 | 20년 전 | 1773 | ||
| 171 | 20년 전 | 2551 | ||
| 170 | 20년 전 | 2257 | ||
| 169 | 20년 전 | 2537 | ||
| 168 | 20년 전 | 1464 | ||
| 167 | 20년 전 | 1564 | ||
| 166 | 20년 전 | 2139 | ||
| 165 | 20년 전 | 1603 | ||
| 164 | 20년 전 | 3748 | ||
| 163 | 20년 전 | 2640 | ||
| 162 | 20년 전 | 2063 | ||
| 161 | 20년 전 | 2768 | ||
| 160 | 20년 전 | 1714 | ||
| 159 | 20년 전 | 1590 | ||
| 158 | 20년 전 | 2543 | ||
| 157 | 20년 전 | 1469 | ||
| 156 | 20년 전 | 1713 | ||
| 155 | 20년 전 | 3220 | ||
| 154 | 20년 전 | 1877 | ||
| 153 | 20년 전 | 1607 | ||
| 152 | 20년 전 | 4933 | ||
| 151 | 20년 전 | 4560 | ||
| 150 | 20년 전 | 3499 | ||
| 149 | 20년 전 | 3770 | ||
| 148 | 20년 전 | 7050 | ||
| 147 | 20년 전 | 3534 | ||
| 146 | 20년 전 | 2599 | ||
| 145 | 20년 전 | 2597 | ||
| 144 | 20년 전 | 7158 | ||
| 143 | 20년 전 | 4582 | ||
| 142 | 20년 전 | 1888 | ||
| 141 | 20년 전 | 3243 | ||
| 140 | 20년 전 | 1944 | ||
| 139 | 20년 전 | 1536 | ||
| 138 | 20년 전 | 2288 | ||
| 137 | 20년 전 | 1766 | ||
| 136 | 20년 전 | 1443 | ||
| 135 | 20년 전 | 1778 | ||
| 134 | 20년 전 | 2957 | ||
| 133 | 20년 전 | 2429 | ||
| 132 | 20년 전 | 1702 | ||
| 131 | 20년 전 | 1629 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기