OOP - User System
View Single Post
11-27-2008, 09:37 AM
Join Date: Sep 2007
Location: Sweden, Stockholm
The first thing I would do, is to create a DB class that manages all the querys and all that.
After you got your DB class, you would begin creating a config file, where you start all your classes, so you create for example $db = new yourdbclass('params');
Then you create a index.php, include your config, and run it. If it displays blank, then you're good to go.
Start creating your user class. There's alot of ways to do a user class, but I would generally do functions in the order they're used:
- check if username and password is correct
- login the user
- logout the user
- register a user
There's no real "guidelines" on how to do this. But just take it easy and whenever you hit a problem, systematicly errorcheck your script on what could be wrong.
The Following User Says Thank You to Tanax For This Useful Post:
View Public Profile
Send a private message to Tanax
Visit Tanax's homepage!
Find More Posts by Tanax