Advertisement
Guest User

login.php

a guest
Mar 10th, 2017
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $users = [
  5.  
  6.     "1" => "1",
  7.     "john" => "pass1",
  8.     "bon" => "pass2",
  9.     "gon" => "pass3"
  10. ];
  11.  
  12. if (isset($_POST['submit'])) {
  13.  
  14.     $username = $_POST['username'];
  15.     $password = $_POST['password'];
  16.  
  17.     foreach ($users as $val => $key) {
  18.  
  19.         if($username == $val && $password == $key) {
  20.             print 'hi';
  21.         } else {
  22.             print 'fuck off';
  23.         }
  24.     }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement