Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // pw: admin/admin
  5.  
  6. try {
  7.     if (empty($_POST['login'])) {
  8.         throw new Exception('Login field is empty');
  9.     }
  10.  
  11.     if (empty($_POST['pass'])) {
  12.         throw new Exception('Password field is empty');
  13.     }
  14.  
  15.     if ($_POST['login'] != 'admin' OR base64_encode($_POST['pass']) != 'YWRtaW4=') {
  16.         throw new Exception('Login or password incorrect');
  17.     }
  18.    
  19.    
  20.    
  21.     echo 'Hi ' . $_POST['login'] . '!';
  22. } catch (Exception $ex) {
  23.     echo $ex->getMessage();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement