Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $userinfo = array(
- 'admin'=>'admin',
- 'user2'=>'password2',
- 'Kek'=>'Lol'
- );
- if(isset($_GET['logout'])) {
- $_SESSION['username'] = '';
- header('Location: ' . $_SERVER['PHP_SELF']);
- }
- if(isset($_POST['username'])) {
- if($userinfo[$_POST['username']] == $_POST['password']) {
- $_SESSION['username'] = $_POST['username'];
- }else {
- }
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="../css/sign.css">
- <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
- <title>Login</title>
- </head>
- <body>
- <?php if($_SESSION['username']): ?>
- <h2 class="yomama" ">Результат</h2>
- <h2 class="yomama"><a href="?logout=1">Logout</a></h2>
- <?php endif; ?>
- <form name="Login" class="form-signin" action="" method="post">
- <input type="text" class="form-control" name="username" placeholder="Username" required="" autofocus="" value="" />
- <input type="password" class="form-control" name="password" placeholder="Password" required="" value="" />
- <input class="btn btn-lg btn-primary btn-block" type="submit"
- value="Submit" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement