PHP 5 installed locally doesn't read classes?
Posted: Thu Jan 25, 2007 11:14 pm
feyd | Please use
Any help or input would be greatly appreciated 
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello everyone,
For the first time, I installed PHP 5 and Apache on my windows xp machine.
Everything worked fine except for classes..which php seems to spit out as text.
Are there any known issues , or did I miss something in the php.ini file?
Here's the code I'm *trying* to use:Code: Select all
class Page
{
var $page;
function Page($template = "template.html") {
if (file_exists($template))
$this->page = join("", file($template));
else
die("Template file $template not found.");
}
function parse($file) {
ob_start();
include($file);
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
function replace_tags($tags = array()) {
if (sizeof($tags) > 0)
foreach ($tags as $tag => $data) {
if (substr($data, 0, 3) == 'inc') { $data = substr($data, 3, strlen($data)); $data = (file_exists($data)) ? $this->parse($data) : $data; }
$this->page = ereg_replace("{" . $tag . "}", $data,
$this->page);
}
else
die("No tags designated for replacement.");
}
function output() {
echo $this->page;
}
}feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]