
abockover
Deleted
Jan 20, 2001, 1:21 PM
Post #3 of 3
(167 views)
|
The following code will open the user database file and search for $username:$password It will then set $logged_in = 1; From there, you can open a custom configuration file for the user (that could contain: first name, last name, age, etc...) All of the values can be called like: $usr_config{'name'} so you can print them out to make a custom user page. open (USERS,"<users/users.db") or die $!; while (<USERS>) { next unless /^\Q$username:$password\E/; $logged_in = 1; last; } if($logged_in) { open(UDB,"users/config/$username.cfg"); @ucfg = <UDB>; close(UDB); foreach $setting (@UDB) { chomp($setting); ($set_name, $set_value) = split(/ = /, $setting); $usr_config{$set_name} = $set_value; } } Hope it helps, Aaron
|