SHARE
TWEET

05. Login

MartinGeorgiev Jan 29th, 2019 (edited) 124 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $username = readline();
  4. $pass = strrev($username);
  5.  
  6. for ($i = 0; $i <= 3; $i++) {
  7.     $input = readline();
  8.     if ($pass == $input) {
  9.         echo "User $username logged in." . PHP_EOL;
  10.         break;
  11.     } else if ($i == 3) {
  12.         echo "User $username blocked!" . PHP_EOL;
  13.     } else {
  14.         echo "Incorrect password. Try again." . PHP_EOL;
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top