Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   password code in javascript (http://www.go4expert.com/forums/password-code-javascript-t15984/)

skp819 29Jan2009 12:54

password code in javascript
 
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 29Jan2009 12:59

Re: password code in javascript
 
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 30Jan2009 11:29

Re: password code in javascript
 
It is just for creating login page.

shabbir 30Jan2009 12:42

Re: password code in javascript
 
Quote:

Originally Posted by skp819 (Post 42196)
It is just for creating login page.

But that means anybody can login.

skp819 31Jan2009 11:13

Re: password code in javascript
 
No that is not like that.

shabbir 31Jan2009 11:28

Re: password code in javascript
 
Quote:

Originally Posted by skp819 (Post 42230)
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.


All times are GMT +5.5. The time now is 17:07.