D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
spre.dominicaninstitute.edu.ng
/
Filename :
admin-auth.php
back
Copy
<?php $error_message = ''; if (isset($_POST['username']) && isset($_POST['password'])) { $manager = $_POST['username']; $password =$_POST['password']; include 'inc/config.php'; $cmem = "SELECT id FROM auth WHERE username='$manager' AND password='$password' LIMIT 1"; $run_cmem = mysqli_query($con, $cmem); $count_mem = mysqli_num_rows($run_cmem); if ($count_mem == 1) { while ($row = mysqli_fetch_array($run_cmem)) { $id = $row['id']; } session_start(); $_SESSION['id'] = $id; $_SESSION['manager'] = $manager; $_SESSION['password'] = $password; header('location: mod-auth'); exit(); } else { $error_message = 'Invalid usename or password, please try again later'; } } $page_title; $page_title = ucfirst(basename(__FILE__, '.php')); if ($page_title === 'index') { $page_title = 'Home'; } $page_title = "Administator's Login"; include 'sections/pages-header.php'; ?> <div class="contact-us-bg container" style="margin-top:50px; margin-bottom:50px;"> <div class="row"> <div class="col-md-8 col-sm-12"> <div class="default-form-area margin-bottom-30"> <div class="section-title"> <h2>Welcome Administrator</h2> <p>Kindly fill the login details</p> <p class="text-danger"> <?= $error_message ?> </p> </div> <form class="default-form" action="<?php echo htmlspecialchars( $_SERVER['PHP_SELF'] ); ?>" method="post"> <div class="row clearfix"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="form-group"> <input type="text" name="username" class="form-control" value="" placeholder="Username *" required=""> </div> <div class="form-group"> <input type="password" name="password" class="form-control required password" value="" placeholder="input your password" required=""> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="form-group"> <!-- <input id="form_botcheck" name="form_botcheck" class="form-control" type="hidden" value=""> --> <button class="thm-btn thm-color width-100" type="submit" data-loading-text="Login in...">Login</button> </div> </div> </div> </form> </div> </div> <div class="col-md-4 col-sm-12"> <?php include_once './sections/sidebar-two.php'; ?> </div> </div> </div> <?php include_once 'sections/footer.php'; ?>