password code in javascript

skp819's Avatar
Contributor
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=password name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>
</body>
</html>
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Any use of it because when you see the source of the page you know which username and password would get me in and also which page it redirects to,
skp819's Avatar
Contributor
It is just for creating login page.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by skp819 View Post
It is just for creating login page.
But that means anybody can login.
skp819's Avatar
Contributor
No that is not like that.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by skp819 View Post
No that is not like that.
It is like that only. You create a page with that login and I would tell you the usernames and passwords.