Please visit our sponsor
UNKNOWN //************************************** // Name: Password protect a page // Description:How can I password protect a page? The simplist and most effective password protection using just clientside JavaScripting, relies on the user not knowing the target filename. Found on the web at:http://www.irt.org // By: Found on the Web // // // Inputs:Where frameName1 and frameName2 are the names of the two frames that you want to change. // // Returns:None // //Assumes: Note, the user can find the directory location, by examining the source, therefore you must protect your directory by placing a default file inside it, which your server will always send when the directory is requested, e.g. index.html, otherwise a directory listing will be sent. It is also possible on Unix systems, to just set the parent (or all) directory's permissions to rwx--x--x and all other files to rwxr--r--. The user cannot get directory listings, but can still access any files there. (Thanks to Mike Crawford for this last tip.) // //Side Effects:None //************************************** <script language="JavaScript"><!-- function go() { window.location.href = "http://www.somewhere.com/" + document.formName.passwordName.value + '.html'; return false; } //--></script> <form name="formName" onsubmit="return go()"> Enter Password: <input type="password" name="passwordName" value="" size="8"> </form>