| Current Path : /var/www/html/llcfapp/public/ |
| Current File : /var/www/html/llcfapp/public/login.php |
<?php require_once('header.php');?>
<div class="container container-margin">
<div class="mx-auto col-10 col-md-10 col-lg-8 col-sm-12">
<form method="post" id="login_form" action="?">
<fieldset>
<h2 class="form-heading">Please Sign In</h2>
<hr class="colorgraph">
<div class="form-group">
<label>User Name</label>
<input type="text" name="username" id="username" class="form-control input-lg" placeholder="Username" value="<?php if(isset($_POST['username'])) echo $_POST['username'];?>">
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" id="password" class="form-control input-lg" placeholder="Password">
</div>
<div class="form-group">
<input type="submit" name="submit" class="btn btn-lg btn-primary btn-block llcf-pri" value="Sign In">
</div>
<div class="form-group">
<div class="g-recaptcha" data-sitekey="6LelX0omAAAAAATmZ4SaLsPCXp4F9kK82OgSFUav"></div>
</div>
<!-- <div class="form-group">
<a href="#" class="btn btn-lg btn-secondary btn-block">Register</a>
</div> -->
</fieldset>
<?php
$user = new User();
$user->logout();
if(isset($_POST['submit'])){
$username = $_POST['username'];
$password = md5($_POST['password']);
if($user->login($username,$password)){
header("location:".Config::getConfig("homeRedirect"));
}else{
$_POST['status'] = 'failure';
?>
<div class="alert alert-danger text-center" role="alert" id="error" style="margin-top: 10px;">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span id="errorMsg">Please enter the valid credentials.</span>
</div>
<?php
exit();
}
}
?>
</form>
</div>
</div>
<?php require_once('footer.php');?>