<?php
if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login']) == 'Login'){
$email = test_input($_POST['lemail']);
$password = test_input($_POST['lpassword']);
$passw = sha1($password);
echo sha1($passw);
$sql = mysqli_query($con,"select admin_id,admin_email,admin_password from admin
where admin_email = '".$email."' and admin_password = '".$passw."'");
$row = mysqli_fetch_array($sql);
if(mysqli_num_rows($sql) == 1){
session_start();
$_SESSION['admin_id'] = $row['admin_id'];
$_SESSION['admin_email'] = $row['admin_email'];
if($_SESSION['admin_id']){
header("Location:jobpost.php");
}}
else{
echo '<center><span class="displayerror">Invalid User Name and Password Combination</span></center>';
}
}
?>
<!------------------------------------------///login code------------------------------------------------->
<h3 class="text-center" style="color:#666666;">
Admin Login
</h3>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
<label for="inputEmail3" >Email</label>
<input type="email" id="inputEmail" name="lemail"/>
<div id="login_email_error" class="displayerror"></div>
<label for="inputPassword3" >Password</label>
<input type="password" id="inputPassword" name="lpassword"/>
<div id="login_password_error" class="displayerror"></div>
<label><input type="checkbox" /> Remember me</label>
<input type="submit" value="Login" name="login" id="submit_login">
</form>
chaitu11 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.