What's wrong with class?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

What's wrong with class?

Post by php_wiz_kid »

<?php
class Template {
function PageHeader() {
echo "<html>\n<head>\n";
}

function DisplayTemplate() {
$this->PageHeader();
}
}
$template = new Template();
$template->DisplayTemplate();
?>

What am I doing wrong?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Nothing.

View source?
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

I did but it's not working, I'll figure it out, thanks.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

What exactly is the problem?

I tested it and view source was showing < head > and < html> OK.
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

Yeah, I went home last night, tried it, and it worked. So something is wrong with the PHP on this machine. I'm going to re-install and see if anything happens. Thanks for you help.
Post Reply