Hi. I am learning PHP - I used to be a ColdFusion developer so it is close enough for me to be a quick study.
Anyhow, I was messing around with objects today. I want to print pages dynamically from an object.
Here's the deal:
My index.php page looks like this:
<?php
include("functions.php");
$content = new DynoPage("home page");
$content->showContent();
?>
My functions.php page looks like this:
<?php
Class DynoPage
{var $pageKey;
var $resultPage;
function DynoPage$pageKey)
{
$this->pageKey = $pageKey;
}
function showContent()
{
$this->resultPage == '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>' + $this->pageKey + '</title>
</head>
<body> etc... </body>
</html>';
return $this->resultPage;
}
}
?>
When I browse my index.php page I get this back from the apache server:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD>
<BODY></BODY></HTML>
Why is Apache sending a this HTML without my permission and why isn't my content showing up as expected?
Thanks for your help - sorry if this is an amatuer question.