I have this script founded on The JavaScript Source but I think you can manage to avoid it
______________________________________________________________
For example, if ...
... you put Password=> password1 | and Username=>member1, you go to page1.html (for example, www.frihost.com/toto/page1.html)
And here comes the problem
If you go to www.frihost.com/toto/page1.html you don't have to put any password
Is there any way to 'hide' (protect) page1.html???
Sorry for my bad english, I hope you understand me
| Code: |
| <html>
<HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function Login(){ var done=0; var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value; password=password.toLowerCase(); if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; } if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; } if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; } if (done==0) { alert("Invalid login!"); } } // End --> </SCRIPT> </HEAD> <BODY> <center> <form name=login> <table width=225 border=1 cellpadding=3> <tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr> <tr><td>Username:</td><td><input type=text name=username></td></tr> <tr><td>Password:</td><td><input type=text name=password></td></tr> <tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr> </table> </form> </center> </body> </html> |
______________________________________________________________
For example, if ...
| Code: |
| if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
|
... you put Password=> password1 | and Username=>member1, you go to page1.html (for example, www.frihost.com/toto/page1.html)
And here comes the problem
If you go to www.frihost.com/toto/page1.html you don't have to put any password
Is there any way to 'hide' (protect) page1.html???
Sorry for my bad english, I hope you understand me
