Hi.
Wondering if any of the JS gurus could give me a hand on this? I have googled till my browsers are sore but can find what I am looking for...
I need a very simple password protect script, no need to be secure, for a friends site that will host about 150 excel documents, he asked me if there was anyway to add a simple login/password script so all 150 members can access their own excel document.
I immediately thought of one of those "password is the file name password protection" scripts as below. Now this would be fine, not much work for me, (untechnical) mate uploads and administers the excel files, renames the file to what ever he wants and sends the members the password... all simple...
The problem with this script is that if the user gets the password wrong they get a 404 - is there anyway of modifying the script so that a bad password returns to a "password incorrect page" ??? I am guessing not but want to avoid using an applet like this one http://home5.swipnet.se/~w-56899/password_main.html
Has anyone got any suggestions please .i.e should i be using ASP or PERL?
[CODE]
<head>
<script language="JavaScript">
function PasswordLogin()
{
document.location.href = document.formlogin.password.value + ".xls";
return false;
}
function CheckEnter(event)
{
var NS4 = (document.layers) ? true : false;
var code = 0;
if (NS4)
code = event.which;
else
code = event.keyCode;
if (code==13)
{
PasswordLogin();
event.returnValue = false;
}
}
</script>
<head>
<body>
<form name="formlogin" onsubmit="PasswordLogin()">
Password: <input type="password" name="password" size="20" onKeyPress="CheckEnter(event)">
<input type="button" value="Login" onclick="PasswordLogin()"></p>
</form>
</body>
cheers
[This message has been edited by FatRod (edited 10-17-2003).]