Jump to content
xisto Community
Sign in to follow this  
iGuest

Password Protect Your Page Its a very simple script, do not use it for any thing serious

Recommended Posts

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...

<script language="javascript"><!--///*This Script allows people to enter by using a form that asks for aUserID 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>LoginArea</b></i></h1></center></td></tr><tr><td><h1><i><b>UserID:</b></i></h1></td><td><formname="login"><inputname="id" type="text"></td></tr><tr><td><h1><i><b>Password:</b></i></h1></td><td><inputname="pass"type="password"></td></tr><tr><td><center><input type="button" value="Login"onClick="pasuser(this.form)"></center></td><td><center><br><inputtype="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).

Share this post


Link to post
Share on other sites

I don't really see any point of using a javascript password protect :lol: anyone, even unexperienced can brake it and "login" or see the content, the only place I might of think is to integrate it with xml and send a http request, yes to use AJAX. :lol:

Share this post


Link to post
Share on other sites

I don't really see any point of using a javascript password protect :lol: anyone, even unexperienced can brake it and "login" or see the content, the only place I might of think is to integrate it with xml and send a http request, yes to use AJAX. :lol:


The point is that now-a-days free hosts don't give all kinds of scripting capabilities, I know that Xisto 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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.