<?php
$cname=$_POST['cname'];
$cpass=$_POST['cpass'];
$stmt = $con->prepare("SELECT * FROM employer WHERE email = ? AND password = ? AND action = 'confirmed' ");
$stmt->bind_param('ss', $_POST['cname'], $_POST['cpass']);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > "0")
{
$member = $result->fetch_assoc();
$_SESSION['SESS_MEMBER_ID'] = $member['id'];
$_SESSION['SESS_EMAIL'] = $member['email'];
session_write_close();
header("location:emp_home.php");
}
else
{
$errmsg_arr[] = 'Wrong Username or Password';
$errflag = true;
if($errflag)
{
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location:employer.php");
}
}
$stmt->close();
This is my code for login but as I've added the "action" in SQL statement that action is confirmed by the Admin only. So I want to ask how can I echo a message like You have not been confirmed by the admin yet, try login after some time when someone already registered but not been confirmed.
The statement be like:
$stmt = $con->prepare("SELECT * FROM employer WHERE email = ? AND password = ? AND action = '' ");