Log in

View Full Version : PHP login script



moose86
11-29-2011, 06:38 PM
Hi guys,

im new at php and would like to know if there is any tutorial to a free php script/code that allows different users to login to different places.

e.g:
u: user1 - p: pass1 > 1.html
u: user2 - p: pass2 > 2.html
u: user3 - p: pass3 > 3.html
u: user4 - p: pass4 > 4.html

i have looked on google but all i can fiind are ones that handle mutiple user login but all go to the same page

Thanks in advance :D

keyboard
11-29-2011, 11:54 PM
Just use a normal login script and then adapt it.

You could make a new field in the username table of a database (SQL) and store in it the name of the page you would like to assosiate (how do you spell that???) with that user. Then after their login has been validated you could use something like this



$usename = (their username);
$check = mysql_query("SELECT * FROM table WHERE username = '$username'")or die(mysql_error());
$info = mysql_fetch_array($check);
$page = $info['fieldname'];
header("Location: $page");