If you're looking for a similar question, check out this link: How to create a login popup using HTML and JavaScript
To show/hide the login form, you can use JavaScript code like this:
<script language="JavaScript" type="text/javascript">
function toggleLogin(showhide){
if(showhide == "show"){
document.getElementById('popupbox').style.visibility="visible";
}else if(showhide == "hide"){
document.getElementById('popupbox').style.visibility="hidden";
}
}
</script>
Here is the structure of the login form:
<div id="popupbox">
<form name="login" action="" method="post">
<center>Username:</center>
<center><input name="username" size="14" /></center>
<center>Password:</center>
<center><input name="password" type="password" size="14" /></center>
<center><input type="submit" name="submit" value="login" /></center>
</form>
<br />
<center><a href="javascript:toggleLogin('hide');">close</a></center>
</div>
Once you have set up the popup login form, feel free to customize it further by adding PHP or any other functionalities you require.