I have a HTML page with a button for admin before you have a popup login and the php of that login to is in another file. And I wanted to know how to do it so that if he accepts the login, he can always go to that button without having to always log in.
I know I need to do this with session but I do not know how to do it and I can not figure out what sites I've been.
Can someone tell me a website that explains how session works or even explain?
Here is the following code for the popup login:
$(document).ready(function() {
$('a.login-window').click(function() {
var loginBox = $(this).attr('href');
$(loginBox).fadeIn(300);
var popMargTop = ($(loginBox).height() + 24) / 2;
var popMargLeft = ($(loginBox).width() + 24) / 2;
$(loginBox).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
$('body').append('<div id="mask"></div>');
$('#mask').fadeIn(300);
return false;
});
$('a.close, #mask').live('click', function() {
$('#mask , .login-popup').fadeOut(300 , function() {
$('#mask').remove();
});
return false;
});
});
<div id="login-box" class="login-popup">
<div id="fechar">
<a href="federados.html" class="close"><img src="images/close_pop.png" class="btn_close" title="Close Window" alt="Close"></a>
</div>
<form method="post" class="signin" action="php/login.php">
<fieldset class="textbox">
<label class="username">
<span>Nome de Utilizador:</span>
<input id="username" name="username" type="text" autocomplete="on" placeholder="Username" required>
</label>
<label class="password">
<span>Palavra-Passe:</span>
<input id="password" name="password" type="password" placeholder="Password" required >
</label>
<br/>
<input type="submit" class="submit_button" value="Iniciar Sessão"/>
<p><a class="forgot" href="#">Forgot your password?</a></p>
</fieldset>
</form>
</div>
PS: The code does not work because it's a popup only works if you click the button.