Advertisement
Guest User

Untitled

a guest
Dec 17th, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php
  2.  
  3. session_start(); $username = $password = $userError = $ok = '';
  4. if(isset($_POST['sub'])){
  5.     $username = $_POST['username']; $password = $_POST['password'];
  6.    
  7.     if($username === 'admin' && $password === 'admin')
  8.     {
  9.         $_SESSION['login'] = true;
  10.         $ok = 'Dane OK';
  11.         sleep(3);
  12.         header('LOCATION:next.php');
  13.         die();
  14.     }
  15.    
  16.     if($username !== 'admin' && $username !== 'admin')$userError = 'Dane niepoprawne';
  17. }
  18.  
  19.  
  20. echo
  21.    
  22. "<!DOCTYPE html>
  23. <html lang='pl'>
  24.    <head>
  25.        <meta charset=utf-8 />
  26.        <title> Login System</title>
  27.        <link rel='stylesheet' href='font-awesome/css/font-awesome.min.css'>
  28.        <link href='https://fonts.googleapis.com/css?family=Orbitron|Sanchez|Space+Mono|VT323' rel='stylesheet'>
  29.    </head>
  30.    <body>
  31.        <div class='form'>
  32.        
  33.            <!-- <img src='images/logo.png' class='logo'> -->
  34.            
  35.            <form name='input' action='{$_SERVER['PHP_SELF']}' method='post' id='login-main'>
  36.            
  37.            <div class='line-error'>
  38.                <div class='error'>$userError</div>  
  39.                <div class='error'>$ok</div>  
  40.            </div>
  41.              
  42.            <div class='line'>
  43.                <span class='label'>
  44.                    <label for='username'>User ID:</label>
  45.                </span>
  46.                <input type='text' value='$username' id='username' name='username' autocomplete='off'/>
  47.            </div>
  48.                
  49.            <div class='line'>
  50.                <span class='label'>
  51.                    <label for='password'>Password:</label>
  52.                </span>
  53.                <input type='password' value='$password' id='password' name='password' autocomplete='off'/>
  54.            </div>
  55.            
  56.            <input type='submit' id='log-in' value='Zaloguj' name='sub' />
  57.                
  58.            </form>
  59.            
  60.        </div>
  61.    </body>
  62. </html>"
  63.  
  64. ;
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement