Advertisement
Sabab

loginagain

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