2
I have a page HTML with an administration button before you have a login popup and the php from that login to is in another file. And I wanted to know how to do so that if he accepts the login, he can always press that button without always having to log in.
I know you have to do this with Session but I don’t know how to do and I can’t understand the sites I’ve been to.
Can someone tell me a website that explains how Session works or even explain?
Here is the following login code popup:
$(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 is a popup only works if you click the button.
You cannot do this only with HTML you need a server language like PHP I’ve seen you use. PHP has Session’s
– Jorge B.
Take a look here
– Maicon Carraro