|
Q152 How do I protect documents so that they are only accessible after entering the correct user id and password?
irt.org | Knowledge Base | JavaScript | Password | Q152 [ previous next ]
Q152 How do I protect documents so that they are only accessible after entering the correct user id and password?
Below follows some JavaScript that should do the trick, it uses the http://www.xxx.yyy/USERID/PASSWORD.htm format:
<SCRIPT LANGUAGE="JavaScript"><!--
function go() {
location.href = 'http://www.xxx.yyy/' + document.passwordForm.userid.value + '/' + document.passwordForm.password.value + '.htm';
return false;
}
//--></SCRIPT>
<FORM NAME="passwordForm" onSubmit="return go()">
<P>Enter userid: <INPUT NAME="userid" TYPE="TEXT">
<P>Enter password: <INPUT NAME="password" TYPE="PASSWORD">
<INPUT TYPE="BUTTON" VALUE="Enter" onClick="go()">
</FORM>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.