Page 1 of 1

this operator

Posted: Tue Jan 21, 2003 10:39 am
by mame
I trie this code from "teach yourself php 4 in 24 hours"
<?php
class first_class
{
var $name;
function sayHello()
{
print "hello";
}
}

$obj1 = new first_class();
$obj1 -> sayHello();
?>
I have easyphp and OS XP on my PC.
If i exec the module I have:

sayHello();?>


What is the problem?

Posted: Tue Jan 21, 2003 11:37 am
by volka
looks like your php-script hasn't been parsed at all.
If you open "view source" in your browser do you see the complete script code? How did you open the page?

HTML extension

Posted: Wed Jan 22, 2003 3:29 am
by mame
I am sorry.....
I saved my script with html file extension. :oops:

Thanks a lot for remark

Posted: Wed Jan 22, 2003 7:40 am
by elipollak
wow .. php can be written using OO

php just gets better and better =)

Posted: Wed Jan 22, 2003 4:29 pm
by evilcoder
PHP has been an OOP Lanugage for a long time now.