The following code creates a simple password login form. The password is the html name of the page you are linking to i.e. if you want to log into "membersonly.html" the password you use would be "membersonly". Of course you can use any text before the .html. This isn't the most secure password protection but it is useful where serious security isn't an issue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to call the page:
On your call from page insert the following -
<script language="JavaScript">
<!--//BEGIN Script
function new_window(url) {link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=200,left=350,top=300");}
//END Script-->
</script>
Suppose the log-in page is in your 'Members' directory,the hyperlink address would be:-
javascript:new_window('members/login.htm')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code for your log-in form would be:-
The page you are linking to needs to be in the same directory as your log-in page. Therefore multiple passwords can be used to log in to different pages. For example your log-in page is in the 'Members' directory. Also in the 'Members' directory are the pages admin.html and guest.html. You now have 2 password options for the other pages in your 'Members' directory, admin and guest.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.