Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1.         if(mysql_num_rows($result) == 0){
  2.             echo 'You have supplied a wrong user/password combination. Please try again.';
  3.         }
  4.         else{
  5.             //set the $_SESSION['signed_in'] variable to TRUE
  6.             $_SESSION['signed_in'] = true;
  7.            
  8.             //we also put the user_id and user_name values in the $_SESSION, so we can use it at various pages
  9.             while($row = mysql_fetch_assoc($result)){
  10.                 $_SESSION['user_id']    = $row['user_id'];
  11.                 $_SESSION['user_name']  = $row['user_name'];
  12.                 $_SESSION['user_level'] = $row['user_level'];
  13.             }
  14.             echo 'Welcome, '. $_SESSION['user_name'].'. <br /><a href="index.php">Proceed to the forum overview</a>.';
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement