0byt3m1n1
Path:
/
home
/
k74ns2xygros
/
www
/
clientms
/
admin
/
[
Home
]
File: index.php
<?php session_start(); error_reporting(0); include('includes/dbconnection.php'); include('includes/function.php'); if (isset($_POST['login'])) { try { $username = $_POST['username']; $password = md5($_POST['password']); $sql = "SELECT ID FROM tbladmin WHERE UserName=:username and Password=:password"; $query = $dbh->prepare($sql); $query->bindParam(':username', $username, PDO::PARAM_STR); $query->bindParam(':password', $password, PDO::PARAM_STR); $query->execute(); $results = $query->fetchAll(PDO::FETCH_OBJ); $count = $query->rowCount(); if ($count > 0) { foreach ($results as $result) { $_SESSION['clientmsaid'] = $result->ID; } $_SESSION['login'] = $_POST['username']; // echo "<script type='text/javascript'> document.location ='dashboard.php'; </script>"; $_SESSION['status'] = "success"; $_SESSION['action'] = "Logged in successfully."; $RedURL = "dashboard.php"; msg_redirect("" . $_SESSION['action'] . "", "" . $RedURL . "", "0"); exit(); } else { $_SESSION['status'] = "error"; $_SESSION['action'] = "Username or Password mismatch!"; $RedURL = "index.php"; msg_redirect("" . $_SESSION['action'] . "", "" . $RedURL . "", "0"); exit(); } } catch (PDOException $e) { $error = $e->getMessage(); $_SESSION['status'] = "error"; $_SESSION['action'] = $error; //"Something Went Wrong. Please try again !!!"; $RedURL = "index.php"; msg_redirect("" . $_SESSION['action'] . "", "" . $RedURL . "", "0"); exit(); } } ?> <!DOCTYPE HTML> <html> <head> <title>Client Management System||Login Page</title> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- Bootstrap Core CSS --> <link href="../assets/css/bootstrap.min.css" rel='stylesheet' type='text/css' /> <!-- Custom CSS --> <link href="../assets/css/style.css" rel="stylesheet" type="text/css"/> <link href="../assets/css/style.css" rel='stylesheet' type='text/css' /> <!-- Graph CSS --> <link href="../assets/css/font-awesome.css" rel="stylesheet"> <!-- jQuery --> <link href='//fonts.googleapis.com/css?family=Roboto:700,500,300,100italic,100,400' rel='stylesheet' type='text/css'> <!-- lined-icons --> <link rel="stylesheet" href="../assets/css/icon-font.min.css" type='text/css' /> <!-- //lined-icons --> <script src="../assets/js/jquery-1.10.2.min.js"></script> <!--clock init--> </head> <body> <div class="error_page"> <div class="error-top"> <h2 class="inner-tittle page">CMS Admin</h2> <div class="login"> <div class="buttons login"> <h3 class="inner-tittle t-inner" style="color: lightblue">Sign In</h3> </div> <?php if ($_SESSION['action'] != NULL && $_SESSION['status'] != NULL) { ?> <div style="margin-bottom: 10px;" class="alert alert-<?php if ($_SESSION['status'] == 'success') { ?>success<?php } else if ($_SESSION['status'] == 'error') { ?>danger<?php } else { ?>warning<?php } ?> alert-dismissable alert-auto-hide no-print"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button> <?php if ($_SESSION['status'] == 'success') { ?><i class="icon fa fa-check"></i><?php } else { ?><i class="icon fa fa-exclamation-triangle"></i><?php } ?> <?php echo $_SESSION['action']; $_SESSION['action'] = NULL; ?> </div> <?php } ?> <form id="login" method="post" name="login"> <input type="text" class="text" value="User Name" onfocus="this.value = '';" onblur="if (this.value == '') { this.value = 'E-mail address'; }" name="username" required="true"> <input type="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') { this.value = 'Password'; }" name="password" required="true"> <div class="submit"><input type="submit" onclick="myFunction()" value="Login" name="login" ></div> <div class="clearfix"></div> <div class="new"> <p><a href="forgot-password.php">Forgot Password?</a></p> <p><a href="../index.php">Back Home!!</a></p> <div class="clearfix"></div> </div> </form> </div> </div> <!--//login-top--> </div> <!--//login--> <!--footer section start--> <div class="footer"> <?php include_once('includes/footer.php'); ?> </div> <!--footer section end--> <!--/404--> <!--js --> <script src="../assets/js/jquery.nicescroll.js"></script> <script src="../assets/js/scripts.js"></script> <!-- Bootstrap Core JavaScript --> <script src="../assets/js/bootstrap.min.js"></script> </body> </html>