Login error

liunx

Guest
alright, so i found a code which makes a login and user name, but for some reason the login button isnt directing the user to the page i set...som one help!<br />
<br />
<br />
<br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<br />
<!-- This script and many more are available free online at --><br />
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> --><br />
<br />
<!-- Begin<br />
function Login(){<br />
var done=0;<br />
var username=document.login.username.value;<br />
username=username.toLowerCase();<br />
var password=document.login.password.value;<br />
password=password.toLowerCase();<br />
if (username=="----" && password=="----") { window.location="http://www.freewebs.com/pandr/practice.html" target=main; done=1; }<br />
if (username=="-----" && password=="-----") { window.location="http://www.freewebs.com/pandr/practice.html" target=main"; done=1; }<br />
if (username=="-----" && password=="-----") { window.location="http://www.freewebs.com/pandr/practice.html" target=main"; done=1; }<br />
if (username=="-----" && password=="-----") { window.location="http://www.freewebs.com/pandr/practice.html" target=main"; done=1; }<br />
if (username=="-----" && password=="-----") { window.location="http://www.freewebs.com/pandr/practice.html" target=main"; done=1; }<br />
if (done==0) { alert("Invalid login!"); }<br />
}<br />
// End --><br />
</SCRIPT><br />
<br />
<!-- STEP TWO: Paste this code into the BODY of your HTML document --><br />
<br />
<BODY><br />
<br />
<center><br />
<form name=login><br />
<table width=225 border=1 cellpadding=3><br />
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr><br />
<tr><td>Username:</td><td><input type=text name=username></td></tr><br />
<tr><td>Password:</td><td><input type=text name=password></td></tr><br />
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr><br />
</table><br />
</form><br />
</center><br />
<br />
<br />
<!-- Script Size: 1.60 KB --><br />
<br />
<br />
any help???<!--content-->Never mind i got it<!--content-->Be aware that javascript is not secure. <br />
<br />
Anyone that does a "view source" can see the list of valid usernames and passwords.<br />
<br />
<br />
To be secure you need to use .htaccess methods, or some server-side script using PHP or ASP, etc.<!--content-->Be aware that javascript is not secure.<br />
That纾
 
Back
Top