Kidlink English  Help | Contact Us | Contents | Volunteers | Support Kidlink? | Privacy | About Us | Search | Log In


Thomas Williams (11), USA
Making Password Protected Web Pages

See how password protection has been included at http://www.kidlink.org/finance/bnotes.html (bottom of page).

A Javascript is included in the web page to allow visitors access to a secret web page by using the page's file name as the password. For example, if the page is called index.html, just enter "index" as the password. In this example, the page resides in a subdirectory called "/archive".

The following code has been included high up in the source of the web page:

<SCRIPT language="JavaScript"><!--
function Kidlink() {
var password = prompt("Password required:", "");
if (password) { this.location.href = "archive/" + password + ".html"; }}
//--></SCRIPT>

At the place where the link to the protected page is included, the following code is being used:

<A HREF="javascript:{;}" onClick="Kidlink(); return false">
Detailed accounts by year
</A> (enter "index" for access)<BR>

<NOSCRIPT><FONT COLOR="#FF0000"><BR>
Javascript is required to access this area. Yours seems to be
disabled.
</FONT></NOSCRIPT>

How to adapt to your page?

To point to a page in the same directory: Just remove "archive/" + from the line above.

To point to another kind of file, for example a .doc (word) document, replace ".html" with the desired code. Example: To find testbudget.xls in the same directory, use: { this.location.href = password + ".xls"; } . The password will be "testbudget".

The green text above is where you work when translating the text into another language, or want to include other kinds of text.

Important hints!

  1. You may experience problems when copying directly from the code above because of the strange ways Windows work. It may be safer to go back to the preceding page, and copy from the source there. Then, edit as you please.
  2. If you store your secret page in the same directory as the page you're linking from, then our search engine will pick it up, and outsiders can get to your information. Therefore, put it in a subdirectory! Then, ask the maintainer of our search engine to exclude this subdirectory from the search engine.

For help, write to Odd de Presno

--------------------------------------------------
Pages in this directory

Search: Advanced

Help | Contact Us | Home | English Home | Member? | Want To Help? | Register | Privacy | About Us
Updated by Odd de Presno - September 1, 2004. Copyright ® 1990-2007 Kidlink - All rights reserved.

Change language Go to the start page for kids. Art by Nevena from Yugoslavia, 2003 Go to Go to Go to Go to KidArt Go to KidProj's projects in KidSpace Go to start page for teachers. Art by Nevena. 10 years. Girl. Yugoslavia

http://www.kidlink.org