Pro PHP5, Ch.15, Class file usage
Hi Everyone,
I'm new and hoping there are brilliant PHP coders out there to help me. I'm trying to include class files and object oriented coding in my stuff. I want to replace my present login and session management system with class files. I'm using "usersession.phpm" from chapter 15 in Professional PHP5, and a MySQL database. My first problem is my host is not up to PHP 5 yet, so I've modified the file to work with PHP 4.
I'm feeling pretty stupid since I can't seem to figure out how to implement the class. I understand how to instantiate the class and I understand that a class must be passed around to each page that needs it. Where I'm stumped is, since this is a session class, how and where do I pass it. Each time I include it in a new page, I get a new session or at least the user class I passed is lost.
Can someone please help me to grasp this concept?
Thanks,
Bill
|