I made a PHP login script but the best I came up with wasn't quite what I expected. It is a emergency solution to have at least a very simple login, but I wanted to get it a little nicer.
The script redirects all people to one single same page. Now I need this script to be rewritten so that it redirects user to their own private page. Please note that I want the script not too be much more complicated or different.
Here is the script I have so far:
<?php
$user_pass_list = array ("user1" => "pass1", "user2" => "pass2");
$user = $_POST['user'];
$pass = $_POST['pass'];
if(array_key_exists($user,$user_pass_list)){
if($user_pass_list[$user] == $pass){
header("location: http://www.examplesite.net");
} else{
echo "login failed";
}
}
?>
As you can see it always direct to examplesite.net, for every user in the array. Now I want the script to redirect an account to its personal page, so that I can write different info on the page, etc.
Can somebody do this?