<?
class Page
{
var $content;
var $title;
function SetTitle ($newtitle)
{
$this->$title = $newtitle;
}
function SetContent ($newcontent)
{
$this->$content = $newcontent;
}
function Display()
{
echo $this->$title;
echo $this->$content;
}
}
?>
Which is called by the following page:
<?
include "page.inc";
$homepage = new Page();
$homepage -> SetContent("general_content.php");
$homepage -> SetTitle("general_title.php");
$homepage -> Display();
?>
Why, when I run the 2nd page, is only "general_title.php" displayed when I echo the $homepage -> $content and $homepage -> $title via the $homepage -> Display() function? I.e., why is $homepage -> $content not resolving to "general_content.php" instead of "general_title.php"?
Thanks to anyone with the patience to hang with this
- Al