PDA

View Full Version : Login Form Question



sidorak95
11-07-2007, 06:04 PM
Does anyone see what I'm doing wrong here?
http://www.fungamesuniverse.com/login/ (http://www.fungamesuniverse.com/login)
There's a error box at the bottom left corner.
When I preview it on Frontpage, some errors come up and say,

A error has been ocured in the script in this page.

Line:17
Char:1
Error:Syntax Error
Code:0
URL:file:///C:/Documents%20and%20Settings/..../Local%20Settings/Temp/FrontPageTempDir/pvw21.htm


Do you want to continue running scripts on this page?


Yes No

and,

Line:19
Char:1
Error:Syntax Error
Code:0
URL:file:///C:/Documents%20and%20Settings/..../Local%20Settings/Temp/FrontPageTempDir/pvw21.htm


Do you want to continue running scripts on this page?


Yes No

This is the code,

<html>
<head>
<title>Please Type Your Username And Password...</title>
<script language="JavaScript" type="text/JavaScript" src="login.js"></script>
</head>
<body bgcolor="#eeeeee">
<form>
<br>
<center>
Username: <input type="text" name="username" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.background = '#ffffff';" onBlur="this.style.background =
= '#bfbfbf';"&gt;
<br>
&nbsp;</center>
<p>
<center>
Password: <input type="password" name="password" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.bacground = '#ffffff';" onBlur="this.style.background =
= '#bfbfbf';"&gt;
<br>
</p>
<p>
<center>
<input type="button" value="Login" onClick="Login(this.form);" style="background:#bfbfbf;color:#000000;border-color:#212121;" onMouseOver="this.style.color = '#404040';" onMouseOut="this.style.color = '#000000';" onFocusr="this.style.color = '#404040';" onBlur="this.style.color = '#000000';"
</center>
</p>
</form>
</body>
</html>

I got it here,
http://www.webdeveloper.com/forum/archive/index.php/t-721.html

(The "Yes No" text is buttons)

Seb
11-07-2007, 06:58 PM
1st. You have lots of spelling mistakes in your code, just go over it and see for yourself... bacground, onFocusr etc.

2nd. There is no login.js file on the location you have specified.

sidorak95
11-08-2007, 05:12 PM
I'm just wondering where I can paste the login.js script in the HTML code. Do i put it in between the <body> and </body> tags?


<!-- Begin

function Login(form) {
username = new Array("u1","u2","u3","u4","u5","u6","u7","u8","u9","u10");
password = new Array("p1","p2","p3","p4","p5","p6","p7","p8","p9","p10");
page = "secretpage" + ".html";
if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9]) {
self.location.href = page;
}
else {
alert("Either the username or password you entered is incorrect.\nPlease try again.");
form.username.focus();
}
return true;
}

// End -->

eskimoet
11-08-2007, 08:18 PM
If you cant get it to work you might want to try Sljplat's "Login Session" script from http://www.myphpscripts.net. It has md5 encryption of your users passwords, writes to a flat file and is extremely to setup up and run.

Or you can try "DBAuth" (Or something) which uses a database and has the ability for users to retrieve their password if they have forgotten it. (I think.. I'm not to sure about it because Ive never used it.. Databases confuse me.)