Forum Moderators: open
<script type='text/javascript'>
function doSubmit()
{
var s = document.login.username.value;
var p = s.indexOf('@');
var d = s.substring(p + 1, s.length);
var u = s.substring(0, p);
document.login.username.value = u;
document.login.action = 'http://www.website.com/'+d+'.html';
document.login.submit();
}
</script>
<form name="login" method="post" action="">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="hidden" name="server_id" value="0">
<input type="hidden" name="template" value="style1">
<input type="hidden" name="language" value="en">
<input type='button' value='login' onclick='javascript:doSubmit();'>
and that at least tries to load the username.html, but after that I'm lost, and I have no clue how to make it check the password, and then load that site if its correct, or take them back to the login page if its not. Any help would be appreciated. Thankyou.
The password can be checked against a hashed version. If it's correct, it's concatenated with username, and the page is redirected. Any good?
HTH
function passwordLogin(){
protectedPage = document.theForm.passwordField.value + ".htm";
document.location.href = protectedPage;
return false;
}
Unfortunately, the wrong password results in a Page Not Found error, which doesn't necessarily tell people that they've put in the wrong password, but at least the password isn't IN the script. Actually, the only practical use of this is to make your users feel good because they get to know and use the password.