Website structure 2
htmlpage.class.php - page object example
<?php
class HTMLPage {
var $title;
function HTMLPage($title="No title") {
$this->title = $title;
}
function start() {
print '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>'. $this->title .'</title>
</head>
<body>
';
}
function end() {
print '
</body>
</html>
';
}
}
?>
about.php - page object example
<?php
// Include class file
include "htmlpage.class.php";
// Initiate HTMLPage object
$page =& new HTMLPage("About me");
$page->start();
?>
<h1>Something about me</h1>
Very interesting text.
<?php
$page->end();
?>