Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['uname']) && isset($_POST['password'])){
- $logged = login($_POST['uname'],$_POST['password']);
- if($logged){
- header( 'Location: index.php' ) ;
- exit();
- }
- }
- function login($uname,$password){
- $user = check_db_user($uname,$password)
- if($user){
- session_regenerate_id(TRUE);
- $_SESSION["name"] = $user->name;
- ...
- return true;
- }else{
- return false;
- }
- }
- header("Set-Cookie: PHPSESSID=" . session_id() . "; path=/");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement