I have a site with a login form inside a div, which clicked modal opens.
<a href='#' id='login-link'>Login</a>
I have some restricted areas on the site, and I would like to display the login form in case the user is not logged in, but I can not.
if(!isset($_SESSION['usuario'])){
//EXIBIR A DIV PARA LOGIN
}
JS
$("#login-link").click(function(){
$("#login-form").fadeIn(300);
document.form1.loading.style.visibility = "hidden";
$("#background-on-popup").css("opacity", "0.7");
$("#background-on-popup").fadeIn(300);
document.getElementById("username").value = "";
document.getElementById("password").value = "";
$("#username").focus();
});