Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_POST['login']))
- {
- include "class.login.php";
- $login = new Login();
- if($login->isLoggedIn())
- {
- header('location: index.php');
- }
- else
- {
- $login->showErrors();
- }
- }
- $token = md5(uniqid(mt_rand(), true));
- $_SESSION['token'] = $token;
- ?>
- <form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
- <table>
- <tr>
- <td>Username:</td>
- <td><input type="text" name="username"></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type="password" name="password"></td>
- </tr>
- </table>
- <input type="hidden" name="token" value="<?=$token;?>">
- <input type="submit" name="login" value="Log In">
- </form>
Add Comment
Please, Sign In to add comment