List Info

Thread: Login Trouble




Login Trouble
user name
2006-08-15 04:42:15
				This is the button.

<input type="button"
value="Login"
MM_openBrWindow('login.htm','Login','width=40,height=30
')" />

			This is the popup login window.

<form>
<table>
	<tr>
	<td>
			<div align="left">Username:
	</td>
	</tr>
	<tr>
	<td>
		<input name="username"
type="text" value=""
/>					</td>
	</tr>
	<tr>
	<td>
         	Password:
	</td>
	</tr>
	<tr>
	<td>
		<input type="password"
name="password" />					</td>
	</tr>
</table>
<table width="149">
	<tr>
	<td width="69">
		<input type="button"
value="Login"
onClick="Login(this.form)" />
	</td>
	<td width="68">
		<div align="right">
		<input name="Reset"
type="reset"
onclick="MM_goToURL('parent','Index.htm');return
document.MM_returnValue" value="Back"
/>
		</div>
	</td>
	</tr>
</table>
</form>

			Ths is the javascript.

<!-- Begin

function Login(form) {
username = new Array("admin");
password = new Array("password");
page = "index/secure" + ".htm";
if (form.username.value == username[0] &&
form.password.value ==
password[0]) {
self.location.href = page;
}
else {
alert("Either the username or password you entered is
incorrect.\nPlease try again.");
form.username.focus();
}
return true;
}

// End -->


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Informationgooglegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
-~----------~----~----~----~------~----~------~--~---

Login Trouble
user name
2006-08-15 17:32:34
Hi,

If client-side scripting is required, you can use cookie to
rememeber
whether user has logged in.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Informationgooglegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
-~----------~----~----~----~------~----~------~--~---

Login Trouble
user name
2006-08-15 23:11:30
First of all it's a bad idea to protect html pages with
only
javascript. Second I trust you can enought javascript to
make this code
work for you need I wrote it in 20min or so.


<html>
	<head>
		<script type="text/javascript">
			function testlogin()
			{
				loginpass=document.getElementById("logintext"
;);
				if(loginpass.value == "fuckthis")
				{
					document.getElementById("login").style.disp
lay = "none";
					document.getElementById("contents").style.d
isplay = "";
				}
			}
		</script>
	<head>
	<body>
		<div id="login"><input
type="text"
id="logintext"><input
type="button" value="checklogin"
onclick="testlogin()"> (tip: password
is fuckthis)</div>
		<div style="display: none"
id="contents">The Griffin is my
lord</div>
	</body>
</html>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Informationgooglegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )