Just started practicing classes and boom my first try cant get it to work ... maybe im not seeing something ... can someone look and point out the thing that i might have misssed .. ?any help would be appreciated .. thanx
here's the code :
index.php
<?
include "page.class.php";
$clan911 = new page;
$data = "<p>Clan 911 </p>";
$clan911->title = 'Clan 911';
$clan911->keywords = 'CLAN 911';
$clan911->setcontent($data);
$clan911->display();
?>
page.class.php
<?
class page
{
var $title;
var $keywords;
var $content;
function display()
{
echo "<html>\n<head>";
$this->displaykeywords();
$this->displaytitle();
echo "</head>\n<body>";
$this->content;
echo '</body>';
echo '</html>';
}
function displaytitle()
{
echo '<title>' . $this->title . "</title>\n";
}
function displaykeywords()
{
echo '<meta name="keywords" content="' . $this->title . '">';
}
function setcontent($data)
{
$this->content = $data;
//echo $data;
}
}
?>
It doesnt print out the content.. somehow the function, i think, is not getting the data sent by $clan911->setcontent($data);