|
|
|
|
![]() ![]() |
Apr 9 2006, 04:09 AM
Post
#1
|
|
|
Advanced Member Group: Banned Posts: 149 Joined: 2-December 05 From: Bangalore, India. Member No.: 9,923 |
Guys, if you like it you can use it, but one thing I would like to tell is that its not entierly safe to use such a thing, it depends on your content that you are trying to protect from usual visitors, beginners this is for you. The best part is that you do not need any kind of scripts installed on your server, it is in JavaScript which is embeded in to your HTML page. Just change the username from "asta" to your choice and password from "host" to your preference.
Here is the code... CODE <script language="javascript"> <!--// /*This Script allows people to enter by using a form that asks for a UserID and Password*/ function pasuser(form) { if (form.id.value=="asta") { if (form.pass.value=="host") { location="page2.html" } else { alert("Invalid Password") } } else { alert("Invalid UserID") } } //--> </script> <center> <table bgcolor="white" cellpadding="12" border="1"> <tr><td colspan="2"><center><h1><i><b>Login Area</b></i></h1></center></td></tr> <tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input name="id" type="text"></td></tr> <tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass" type="password"></td></tr> <tr><td><center><input type="button" value="Login" onClick="pasuser(this.form)"></center></td><td><center><br><input type="Reset"></form></td></tr></table></center> Your username and password can be viewed from the source code of your page, just to make it more secure, encrypt. And now, if you are thinking "How am I going to encrypt a page?", visit this page (http://www.cyberiapc.com/aascripter/samples/Security/sub9.htm), over here you just have to paste your java script code and it will encrypt it for you. On this page you can even give it an encrypted code and it will decrypt it for you (bring it back to its original state). Thus the above script must not be used for anything serious. If you plan to go and hide something more serious try, Bravenet.com service which is much, much secure, its just like loging into your email ID (yahoo or hotmail). |
|
|
|
Apr 9 2006, 04:50 AM
Post
#2
|
|
|
the Q Group: [HOSTED] Posts: 1,051 Joined: 13-July 05 From: Lithuania, Vilnius Member No.: 7,059 |
I don't really see any point of using a javascript password protect
|
|
|
|
Apr 9 2006, 08:53 AM
Post
#3
|
|
|
Advanced Member Group: Banned Posts: 149 Joined: 2-December 05 From: Bangalore, India. Member No.: 9,923 |
I don't really see any point of using a javascript password protect The point is that now-a-days free hosts don't give all kinds of scripting capabilities, I know that AstaHost give unlike others. I already told you that using the encryption method will be better, because it makes it difficult, and one more thing I mentioned was that, it should not be used for anything serious. You could use it to protect some page in your hooby site or something like that, not anything tooooooo private or serious. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 05:11 AM |