Parse error: syntax error, unexpected '<' in E:\DATA\xampp\htdocs\test\untitled\chkerror.php on line 10<?php
class Page {
var $page; function Page( ) {
$this->page = '';
} function addHeader($title) {
$this->page .= "
<html> <head> <meta http-equiv=content-type content=\"text/html; charset=UTF-8\"> <title>$title </title> </head>
<body> <h1 align=\"center\">$title </h1>
";
} function addContent($content) {
$this->page .= $content;
} function addFooter ($year, $copyright) {
$this->page .= " <div align = \"center\"> © $year $copyright </div> </body>
</html>
";
} function get() {
return $this->page;
}
}
$webpage = new Page( );
$webpage->addHeader('this is header');
$webpage->addContent(' <p>dfadfadfad adfadfadfadfadf afdadfd </p>');
$webpage->addFooter(date('Y'), 'copyright yijiang'); echo $webpage->get(); ?>
class Page {
var $page; function Page( ) {
$this->page = '';
} function addHeader($title) {
$this->page .= "
<html> <head> <meta http-equiv=content-type content=\"text/html; charset=UTF-8\"> <title>$title </title> </head>
<body> <h1 align=\"center\">$title </h1>
";
} function addContent($content) {
$this->page .= $content;
} function addFooter ($year, $copyright) {
$this->page .= " <div align = \"center\"> © $year $copyright </div> </body>
</html>
";
} function get() {
return $this->page;
}
}
$webpage = new Page( );
$webpage->addHeader('this is header');
$webpage->addContent(' <p>dfadfadfad adfadfadfadfadf afdadfd </p>');
$webpage->addFooter(date('Y'), 'copyright yijiang'); echo $webpage->get(); ?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货