Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include('dbconn.php');
- $error_msg = "";
- $sumbit = filter_input(INPUT_POST, 'submit');
- if (isset($sumbit)) {
- $username = filter_input(INPUT_POST, 'username');
- $password = filter_input(INPUT_POST, 'password');
- if ($username != "" || $password != "") {
- $result = $db->query("SELECT `admin_login_id`, `admin_login_username`, `admin_login_status` FROM `acl_admin_login` WHERE `admin_login_username`='" . $username . "' and `admin_login_password`='" . md5($password) . "'");
- if ($result->num_rows > 0) {
- $row = $result->fetch_assoc();
- if ($row['admin_login_status'] == 1) {
- $_SESSION['name'] = $row['admin_login_username'];
- header("Location:aaaa.php");
- } else {
- $error_msg = "Sorry, we couldn't allow that username.";
- }
- } else {
- $error_msg = "username or password are wrong";
- }
- } else {
- $error_msg = "Please fill username & password";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Testing</title>
- <link rel="shortcut icon" href="images/logo.png" />
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="css/bootstrap.min.css">
- <link href='https://fonts.googleapis.com/css?family=Asset|Diplomata+SC|Montserrat|Merriweather:400,900,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="css/style.css">
- </head>
- <body>
- <div class="">
- <form class="form-signin col-lg-offset-3 col-lg-6" id="login-form" action="login.php"
- method="POST">
- <h2 class="form-signin-heading">Login</h2>
- <label class="sr-only" for="inputUsername">Username</label>
- <input type="text" autofocus="" name="username" required="" oninvalid="this.setCustomValidity('Please insert your username')" placeholder="username" class="form-control" id="inputUsername">
- <label class="sr-only" for="inputPassword">Password</label>
- <input type="password" oninvalid="this.setCustomValidity('Please insert your password')" required="" name="password" placeholder="Password" class="form-control" id="inputPassword">
- <br>
- <button type="submit" class="btn btn-lg btn-primary btn-block submit" name="submit" >Sign in</button>
- <?php
- if ($error_msg != null || $error_msg != '') {
- echo "<br><p style=\"color:red;\font-size:20px;\">" . $error_msg . "</p>";
- }
- ?>
- </form>
- </div>
- <script src="js/jquery-2.2.0.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <script src="js/main.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement