Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <form method="post" action="index.php">
- username:<br/>
- <input type="text" name="username"><br/>
- password:<br/>
- <input type = "password" name="password"><br/>
- <input type = "submit" value="Login!">
- </form>
- <body>
- </body>
- </html>
- <?php
- session_start();
- $username = "user";
- $password = "password";
- if (isset($_SESSION['Logged_in']) && $_SESSION['Logged_in'] == true){
- header("Location: sucess.php");
- }
- if ( isset($_POST['username']) && isset($_POST['password'])) {
- if($_POST['username'] == $username && $_POST['password'] == $password)
- {
- $_SESSION['Logged_in'] = true;
- header("Location: sucess.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement