아래 소스를 실행해보니 다음과 같은 에러가 나는데 어디가 잘못되었는지 모르겠어요.
도와주세요. 소스는 "성공적인 웹 프로그래밍 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>
이렇게 해주시면 되겠네요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 830 |
|
19년 전 | 2192 | |
| 829 |
|
19년 전 | 1935 | |
| 828 |
|
19년 전 | 1818 | |
| 827 |
|
19년 전 | 1657 | |
| 826 |
|
19년 전 | 1856 | |
| 825 |
|
19년 전 | 1903 | |
| 824 |
|
19년 전 | 1959 | |
| 823 |
|
19년 전 | 2695 | |
| 822 |
|
19년 전 | 5333 | |
| 821 |
|
19년 전 | 1728 | |
| 820 |
|
19년 전 | 1584 | |
| 819 |
|
19년 전 | 1448 | |
| 818 |
|
19년 전 | 1610 | |
| 817 |
|
19년 전 | 1531 | |
| 816 |
|
19년 전 | 1450 | |
| 815 |
|
19년 전 | 1464 | |
| 814 |
|
19년 전 | 1386 | |
| 813 |
|
19년 전 | 1452 | |
| 812 | 19년 전 | 2827 | ||
| 811 |
pearly
|
19년 전 | 3844 | |
| 810 |
pearly
|
19년 전 | 5222 | |
| 809 |
|
19년 전 | 1388 | |
| 808 |
pearly
|
19년 전 | 4545 | |
| 807 | 19년 전 | 2983 | ||
| 806 |
|
19년 전 | 1507 | |
| 805 |
|
19년 전 | 2698 | |
| 804 |
|
19년 전 | 3624 | |
| 803 |
|
19년 전 | 1817 | |
| 802 |
|
19년 전 | 3793 | |
| 801 |
|
19년 전 | 1885 | |
| 800 | 19년 전 | 3773 | ||
| 799 | 19년 전 | 3442 | ||
| 798 | 19년 전 | 4211 | ||
| 797 | 19년 전 | 4082 | ||
| 796 |
|
19년 전 | 1900 | |
| 795 |
|
19년 전 | 1860 | |
| 794 | 19년 전 | 4281 | ||
| 793 | 19년 전 | 2677 | ||
| 792 | 19년 전 | 2552 | ||
| 791 | 19년 전 | 2408 | ||
| 790 | 19년 전 | 1986 | ||
| 789 | 19년 전 | 2598 | ||
| 788 | 19년 전 | 2212 | ||
| 787 | 19년 전 | 1854 | ||
| 786 | 19년 전 | 1979 | ||
| 785 | 19년 전 | 1449 | ||
| 784 |
|
19년 전 | 1700 | |
| 783 | 19년 전 | 2844 | ||
| 782 |
|
19년 전 | 1970 | |
| 781 | 19년 전 | 3257 | ||
| 780 | 19년 전 | 3164 | ||
| 779 |
|
19년 전 | 2252 | |
| 778 |
|
19년 전 | 1806 | |
| 777 | 19년 전 | 2847 | ||
| 776 | 19년 전 | 2914 | ||
| 775 | 19년 전 | 4025 | ||
| 774 |
|
19년 전 | 1993 | |
| 773 | 19년 전 | 2628 | ||
| 772 | 19년 전 | 2346 | ||
| 771 | 19년 전 | 3475 | ||
| 770 |
|
19년 전 | 1445 | |
| 769 | 19년 전 | 1508 | ||
| 768 | 19년 전 | 1779 | ||
| 767 | 19년 전 | 2205 | ||
| 766 | 19년 전 | 1837 | ||
| 765 | 19년 전 | 1698 | ||
| 764 |
|
19년 전 | 2117 | |
| 763 |
|
19년 전 | 2231 | |
| 762 |
|
19년 전 | 4965 | |
| 761 | 19년 전 | 2335 | ||
| 760 |
|
19년 전 | 3198 | |
| 759 | 19년 전 | 2646 | ||
| 758 |
|
19년 전 | 2410 | |
| 757 | 19년 전 | 4706 | ||
| 756 | 19년 전 | 2574 | ||
| 755 |
|
19년 전 | 2420 | |
| 754 |
|
19년 전 | 1970 | |
| 753 |
|
19년 전 | 1746 | |
| 752 |
pearly
|
19년 전 | 3375 | |
| 751 | 19년 전 | 2353 | ||
| 750 |
|
19년 전 | 6169 | |
| 749 | 19년 전 | 2043 | ||
| 748 |
|
19년 전 | 1911 | |
| 747 |
|
19년 전 | 2711 | |
| 746 |
|
19년 전 | 1824 | |
| 745 | 19년 전 | 2288 | ||
| 744 | 19년 전 | 2118 | ||
| 743 |
|
19년 전 | 3576 | |
| 742 | 19년 전 | 2588 | ||
| 741 | 19년 전 | 2751 | ||
| 740 |
|
19년 전 | 4377 | |
| 739 | 19년 전 | 3554 | ||
| 738 |
|
19년 전 | 2311 | |
| 737 | 19년 전 | 4321 | ||
| 736 | 19년 전 | 3279 | ||
| 735 |
홀로남은자
|
19년 전 | 4151 | |
| 734 |
홀로남은자
|
19년 전 | 2032 | |
| 733 |
홀로남은자
|
19년 전 | 2236 | |
| 732 | 19년 전 | 2147 | ||
| 731 | 19년 전 | 3361 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기