Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_destroy()
- error_reporting(E_ALL); ini_set('display_errors', 1);
- //login.php
- session_start();
- require_once 'includes/global.inc.php';
- $error = "";
- $username = "";
- $password = "";
- //check to see if they've submitted the login form]
- if(isset($_POST['submit-login'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $userTools = new UserTools();
- if($userTools->login($username, $password)){
- //successful login, redirect them to a page
- //header("Location: index.php");
- }else{
- $error = "Incorrect username or password. Please try again.";
- }
- }
- ?>
- <html>
- <head>
- <title>Login</title>
- </head>
- <body>
- <form action="login.php" method="post">
- Username: <input type="text" name="username" value="<?php echo $username; ?>" /><br/>
- Password: <input type="password" name="password" value="<?php echo $password; ?>" /><br/>
- <input type="submit" value="Login" name="submit-login" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement