Advertisement
Sabab

login

Jan 31st, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. if ($result->num_rows > 0)  {
  2.     // output data of each row
  3.  
  4.     // using loop we are getting following information
  5.     $user_id="";
  6.     $email="";
  7.     $username="";
  8.     while($row = $result->fetch_assoc()) {    
  9.           $user_id=$row["user_id"];
  10.           $email=$row["email"];
  11.           $username=$row["username"];    
  12.     }
  13.  
  14.  
  15.     $_SESSION['user_id'] = $user_id;
  16.     $_SESSION['email'] = $email;
  17.     $_SESSION['username'] = $username;
  18.     $_SESSION['flag'] = true;
  19.  
  20.     header("location: home.php");
  21.  
  22.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement