Shadrik wrote: > Hey there. > I just need a pointer in the right direction atm. > I want to create a user login area on my site but have no idea where to > start or how this is gonna occur. > I want a directory for each new user to store their stuff in and for the > site to remember who they are and pull /place details from/to a user > record in a file as needed. > this has been done to death i know. so there must be a standard approach > to it. I tried lookin for tutorials but to no avail. > any help appreciated. > thanks > Shad,
Here is how I do it in my program. It works very well. I use a MySQL table to keep the username and another to store the session information. I store the session information in the database to have control over how many times a user logs in with the same username. PHP SESSION variables can be used here instead of a seperate table. When a user logs in, I check if the username and password combination is correct, then just execute one function after another. ClearExpiredUsers($inc_dir,$CONF);//Clear All expired Users ClearUserMaxLogin($CONF,$User_ID);//Remove the longest Idle user if MaxLoginCount has been reached ClearSameSSID($inc_dir,$CONF); //Clear all Users with the same SSID UserFirstLogin($inc_dir,$User_ID,$CONF);//Login User, add to database Once the user is authenticated I add their SSID to the URL, the SSID can be found in the login table. Every time a user opens a website I run my ValidateUserFunction($SSID) which takes the SSID and compares it to the value in the database. If it is there I check if the login has expired and how many other connections I have from the same IP. I have been told that checking for IP is dangerous because some ISPs are sending out traffic from different IPs. Here is my table structure: workorder_users; | User_ID | int(10) unsigned | auto_increment | | User_name | varchar(255) | | | User_password | varchar(35) | | | User_rights | varchar(255) | | | User_active | tinyint(1) | | | User_system | tinyint(1) unsigned | | | User_skills | varchar(255) | | | User_email | varchar(255) | | workorder_users_login; | Login_ID | bigint(20) unsigned | auto_increment | | Login_USER_ID | int(10) unsigned | | | Login_ssid | varchar(200) | | | Login_ip | varchar(200) | | | Login_time | datetime | | Sure you can do it with a flat file database but MySQL makes it much simpler, IMHO. BTW, who here belongs to Agoda. CHECK YOUR E-MAIL I get a reply from your damn mail system every time I reply to this group.
