Code: Select all
<?php
require('page.inc');
$homepage = new Page();
$homepage->content = " <h3>Vic Demone’s music and live shows are an explosive celebration of melodies, beats and stories.
</h3>
<p> While Vic Demone’s primary instrument is his song writing, his distinct voice and powerful performances have proven to be an undisputed force in his ability to engage with the audience.
</p>";
$homepage->Display();
?>Code: Select all
<?php
class Page
{
// class Page's Attributes
public $content;
public $title = 'Vic Demone';
public $keywords = 'Vic Demone, music, band, Dror, Mohar';
public $stylesheet = 'vicDemone.css';
// class Page's Operations
public function __set($name, $value)
{
$this->$name = $value;
}
public function Display()
{
echo "<html>\n<head>\n";
$this -> DisplayHead();
echo "</head>\n<body>\n<div id=\"main\">";
$this -> DisplayNav();
$this -> DisplayContent();
$this -> displayFooter();
echo "\n</div>\n</body>\n</html>\n";
}
public function DisplayHead()
{
echo ' <title>'.$this->title.'</title>
<meta name="keywords" content="'.htmlentities($this->keywords).'" />
<link rel="stylesheet" type="text/css" href="'.$this->stylesheet.'" />';
}
public function DisplayNav()
{
require('nav.php');
}
public function DisplayContent()
{
echo ' <div id="content">
'.$this->content.'
</div>';
}
public function DisplayFooter()
{
require('footer.php');
}
}
?>I know some of the code may seem a bit basic or badly written, but I'm new!
Can anyone help me out?
Thanks
Henry