Results 1 to 4 of 4
- 11-14-2011, 09:18 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 2
- Rep Power
- 0
Please help with Pasword protected page Java script..!
Can someone help me to edit this code...? PLEASE. it will take just 3 minutes...:)
NOTE: this page has "User name" and "password" to login or redirect to another page.. But I dont need the password option.. I just need the " user name" , something very easy..
I just want he visitor to Enter his/her "user name" and press login and the website will take him/her to the page that will be designed for this specific user..
So, I just want to have unlimited "user names" but NO passwords....
Can SOMEONE HELP ME WITH THIS... :)
======================
Here is the code to edit:
===============================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- The JavaScript Source -->
<!-- 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=0 cellpadding=0>
<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=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
<p> </p>
</center>
<p>
<p>
</body>
</html>
- 11-14-2011, 09:22 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
Re: Please help with Pasword protected page Java script..!
This is a Java forum; Java and Javascript are two quite different languages; better try again in a Javascript forum.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-15-2011, 08:04 PM #3
Member
- Join Date
- Nov 2011
- Posts
- 2
- Rep Power
- 0
Re: Please help with Pasword protected page Java script..!
RE: This is a Java forum; Java and Javascript are two quite different languages; better try again in a Javascript forum......"
And were I can find a Java Script forum...?
- 11-15-2011, 08:13 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
How to invoke shell script from JSP page
By rajesh4851 in forum New To JavaReplies: 7Last Post: 01-09-2012, 10:02 AM -
Using Protected Methods, in a Java Library
By WACman in forum New To JavaReplies: 3Last Post: 03-11-2011, 08:47 AM -
Read pasword protected Excel file
By vijay7539 in forum Advanced JavaReplies: 1Last Post: 11-27-2009, 05:13 PM -
pasword script
By ExGM in forum Java AppletsReplies: 4Last Post: 11-13-2009, 03:50 PM -
Ask for help on Java access to protected methods
By fangzhong in forum Advanced JavaReplies: 3Last Post: 02-17-2009, 01:50 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks