PDA

View Full Version : login system


{runecklb}
12-09-2002, 12:50 PM
Hi does anyone know how i could get a login system where it is impossible wo find the login and passwords from the source code, allows more than one user to login from the one page and blocks the pages from being viewed if a valid password wasnt used? please help me because i need a secure login system for my site.

piglet
12-09-2002, 12:57 PM
Hi {runecklb},

No - you can't do this with client side javascript. Any code you use to check input on the client side can be seen by anyone who knows the slightest thing about the web.

Using Javascript about the only way you can implement a password is to have the password = to the name of you secured page:

If your password is "foo" then you set up a passord protected page named foo.html and get to it like this.

<script type="text/javascript">
<!--
p = prompt("Password","");
if (p) location.href=p+".html";
//-->
</script>


I know this is not very satifactory - but you can't do anything better without using server side scripting.

Roelf
12-09-2002, 01:38 PM
If you have a limited number of users you want to give access, this might do the trick: http://codingforums.com/showthread.php?s=&threadid=10114

and i think it IS secure