Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $error = "";
- if(isset($_POST['username'],$_POST['password'])){
- $user = array(
- "user" => "user",
- "pass"=> "user"
- );
- $username = $_POST['username'];
- $pass = $_POST['password'];
- if($username == $user['user'] && $pass == $user['pass']){
- session_start();
- $_SESSION['simple_login'] = $username;
- header("Location: home.php");
- exit();
- }else{
- $error = '<div class="alert alert-danger">Invalid Login</div>';
- }
- }
- ?>
- <html>
- <head>
- <title>Login Teste</title>
- </head>
- <body>
- <?php echo $error; ?>
- <form accept-charset="UTF-8" role="form" method="post" action="index.php">
- <fieldset>
- <legend>Login</legend>
- <input placeholder="Username" name="username" type="text"><br>
- <input placeholder="Password" name="password" type="password" value=""><br>
- <input type="submit" value="Login">
- </fieldset>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement