...

View Full Version : Help with non secure login and redirect



jonathanschiffe
02-11-2005, 04:17 PM
I'm trying to create and login and redirect on my home page for my clients. I am a designer not a coder, so I want something very simple (HTML, Jave Script). The scripts I have are close but I'm still not able to get a redirect. Thank you for any help.

Here are the scripts

HTML file

Index.html

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=macintosh">
<title>My Password Form</title>
</head>
<script language="JavaScript" type="text/JavaScript" src="login_password_info.js"></script>
<body>

<!-- BEGIN LOGIN FORM -->
<form name="login" action="javascript:nextPage()" method="POST" onsubmit="check_login(this)">
username: <input type="text" name="username" value=""><br>
password: <input type="pasword" name="password" value=""><br>
<input type="submit" value="SUBMIT" name="submit">
</form>
<!-- END LOGIN FORM -->

</body>
</html>


Java Script file

login_password_info.js

// ------- PASSWORDS AND REDIRECTS ---------
var login_array = [
["jon","athan","http://www.designiskinky.com"],
["cyn","thia","http://www.designinteract.com"],
["username","password","http://www.yahoo.com"]
];



// ------- FUNCTIONS ---------
function check_login (thisForm) {
for (var i in login_array) {

if (thisForm.username.value == "") {
alert("Please enter your username.");
thisForm.username.focus();
return false;
}

if (thisForm.password.value == "") {
alert("Please enter your password.");
thisForm.username.focus();
return false;
}

if ((login_array[i][0] == thisForm.username.value) && (login_array[i][1] == thisForm.password.value)) {
// alert(login_array[i][2]);
theURL = login_array[i][2]
document.location.href = theURL;
} else {
alert("Your username and password do not match our records. Please try again.");
return false;
}
}
}

Basscyst
02-12-2005, 12:11 AM
What is the point of a non-secure log in. That's like having a key to your car, but everyone elses key works too if they wiggle it 3 times. ;)

This is a fairly secure login with javascript and has detailed info on it's usage:

http://www.codingforums.com/showthread.php?t=10114

Basscyst

jonathanschiffe
02-12-2005, 06:26 AM
That script is perfect and as far as the non-secure login. It's more for the ability to keep clients from looking at other clients projects. I don't think they’re going to hack my site to see what else I'm working on. But thanks a lot those scripts are perfect..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum