Advertisement
Sparkster

Untitled

Oct 15th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(isset($_POST['username'])) {      
  2.         if(strlen($_POST['username']) >= 3 && strlen($_POST['password']) >= 6) {
  3.                 $logged_user = $user_api->login($_POST['username'], $_POST['password']);
  4.                 echo "<h1>IT WORKED! Welcome back to Clementeene {$_POST['username']}</h1> <a href='index.php'>Go play!</a>";
  5.  
  6.                 echo "<a href='usercp.php'>Go to control panel</a>";
  7.  
  8.                 $_SESSION["logged_in"] = true;
  9.                 $_SESSION["username"] = $logged_user['username'];
  10.                 $_SESSION["user_id"] = $logged_user['id'];
  11.        
  12.         if($logged_user == false) {
  13.                 echo "Wrong username or password. Or username or password length wrong";
  14.                 }
  15.         }
  16.  
  17.  
  18.         else {
  19.                 echo "Username and/or password too short.";
  20.                 }
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement