Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ob_start();
- include '../_inc/loader.php';
- ?>
- <html>
- <head>
- <title>PersonalCMS - Administration</title>
- <meta http-equiv="X-UA-Compatible" content="IE=9" />
- <link href="_style/style.css" rel="stylesheet" type="text/css">
- </head>
- </html>
- <?php
- if($user->loggedIn()) {
- echo header("Location: _dashboard/index.php");
- } else {
- if(isset($_POST['username']) || isset($_POST['password'])) {
- $username = $security->data($_POST['username']);
- $password = $security->encrypt($_POST['password']);
- $user1 = $db->query("SELECT * FROM `users` WHERE `username` = '{$username}' && `password` = '{$password}'");
- $usernum = $db->num($user1);
- if($usernum == 0) {
- ?>
- <html>
- <body>
- <div id="login_box">
- <div id="inner_login_box">
- <br /><br />
- <img src="_style/images/wrong_logo.png" />
- <br /><br />
- <form action="login.php" method="post">
- <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
- <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
- <input type="submit" value="Login" class="text_button" />
- </form>
- </div>
- </div>
- <br /><br />
- <div class="red_text">
- Incorrect information! Please try again!
- </div>
- </body>
- </html>
- <?php
- } else {
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- header("Location: _dashboard");
- }
- }
- elseif(empty($_POST['username']) || empty($_POST['password'])) {
- ?>
- <html>
- <body>
- <div id="login_box">
- <div id="inner_login_box">
- <br /><br />
- <img src="_style/images/wrong_logo.png" />
- <br /><br />
- <form action="login.php" method="post">
- <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
- <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
- <input type="submit" value="Login" class="text_button" />
- </form>
- </div>
- </div>
- <div class="red_text">
- Field left blank! Please try again!
- </div>
- </body>
- </html>
- <?php
- }
- ?>
- <html>
- <body>
- <div id="login_box">
- <div id="inner_login_box">
- <br /><br />
- <img src="_style/images/logo.png" />
- <br /><br />
- <form action="login.php" method="post">
- <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
- <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
- <input type="submit" value="Login" class="text_button" />
- </form>
- </div>
- </div>
- </body>
- </html>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement