this operator

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
mame
Forum Newbie
Posts: 2
Joined: Tue Jan 21, 2003 10:39 am

this operator

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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?
mame
Forum Newbie
Posts: 2
Joined: Tue Jan 21, 2003 10:39 am

HTML extension

Post by mame »

I am sorry.....
I saved my script with html file extension. :oops:

Thanks a lot for remark
elipollak
Forum Newbie
Posts: 22
Joined: Sun Jan 19, 2003 10:23 pm

Post by elipollak »

wow .. php can be written using OO

php just gets better and better =)
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

PHP has been an OOP Lanugage for a long time now.
Post Reply