Hi,
I have a php code and I'm trying to implement a login functionality using jquery data-popup. Currently, it works when I click a button:
<a href="#" data-popup=".popup-login" class="open-popup"><img src="images/icons/blue/lock.png" alt="" title="" /><span>LOGIN</span></a>
What I want is that this popup should open automatically when a certain condition is met.
$login = $_REQUEST['login'];
if (!isset($_SESSION['employee_id']))
{
if ($login=="success");
else if ($login=="fail")
{
// OPEN THE POPUP AGAIN
}
}
This is the HTML of the login form that pops up:
<!-- Login Popup -->
<div class="popup popup-login">
<div class="content-block">
<h4>LOGIN</h4>
<div class="loginform">
<form id="LoginForm" method="post" action="login.php">
<input type="text" name="username" value="" class="form_input required" placeholder="username" />
<input type="password" name="password" value="" class="form_input required" placeholder="password" />
<div class="forgot_pass"><a href="#" data-popup=".popup-forgot" class="open-popup">Forgot Password?</a></div>
<input type="submit" name="submit" class="form_submit" id="submit" value="SIGN IN" />
</form>
</div>
</div>
</div>
What I want is, if the session variable is not available, and the login is incorrect, the popup box should keep appearing, so that the user does not have access to anything else.
I am not very experienced with jquery, and I cannot figure out how I can make the login box appear automatically if the $login variable is "fail".
Any help would be appreciated.