Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 'On');
- session_start();
- include_once 'db/dbconnect.php';
- include_once 'classes/User.php';
- include_once 'classes/UserDAO.php';
- $userDAO = new UserDAO();
- if ($_SESSION['user'] != null) {
- header("Location: home.php");
- }
- if (isset($_POST['btn-login'])) {
- $username = $_POST['username'];
- $upass = $_POST['pass'];
- $newUser = $userDAO->check_login($username, $upass);
- if ($newUser != null) {
- $_SESSION["user"] = $newUser;
- header("Location: home");
- } else {
- ?>
- <script>alert('wrong details');</script>
- <?php
- }
- }
- ?>
- <!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 http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>VoluCron BotWatch</title>
- <link rel="stylesheet" href="css/index.css" type="text/css"/>
- <link rel="shortcut icon" type="image/png" href="resources/favicon.ico"/>
- </head>
- <body>
- <center>
- <img src="resources/mainpage.png">
- <div id="txtindex">
- <h3>
- VoluCron Users: <?php echo $userDAO->getTotalUsers(); ?>
- </h3>
- </div>
- <div id="login-form">
- <form method="post">
- <table align="center" width="30%" border="0">
- <tr>
- <td><input type="text" name="username" placeholder="Your Username" required/></td>
- </tr>
- <tr>
- <td><input type="password" name="pass" placeholder="Your Password" required/></td>
- </tr>
- <tr>
- <td>
- <button type="submit" name="btn-login">Sign In</button>
- </td>
- </tr>
- </table>
- </form>
- </div>
- <div class="tos">By logging in you accept our <a href="/resources/VOLUCRONTOS.txt">TOS</a></div>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement