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!
You're trying to call the object's method from within a function even though you instantiate the object outside the function. Therefore the object does not exist. Either declare it global at the top of the function, or pass it as a parameter.
Thanks for your help guys.
I couldn't call it like that because pageContent() was called in a different file.
I fixed the problem by moving the $myfile line inside the function.
I might be wrong on some of the PHP4 stuff inside the function (I haven't messed with PHP4 in a while), but you can kinda see the way things would work.