Hi All,
Can anybody see my error with this following class?
im expecting it to show a blank page, but with a title, and when i view source to show the page structure.
<?php
class webpage {
private $doctype = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">";
private $head = "<html><head>";
private $title = "</head><title>success";
private $body = " </title><body>";
private $ender = "</body></html>";
private function __construct(){
$this->doctype = $doctype;
$this->head = $head;
$this->title = $title;
$this->body = $body;
$this->ender = $end;
}
public function content(){
$page = $this->doctype;
$page .= $this->head;
$page .= $this->title;
$page .= $this->body;
$page .= $this->ender;
return $page;
}
}
//class indexPage extends webpage{
//
//}
$thing = new webpage();
echo $thing->content();
?>