eHow launches Android app: Get the best of eHow on the go.

How To

How to Password-Protect a Web Page

Contributor
By eHow Contributing Writer
(102 Ratings)

Password protection keeps only the users you want on your page. If you know JavaScript or even plain old HTML, you can use password protection.

Difficulty: Easy
Instructions

    Placing a Link from an Unprotected Page to a Protected Page

  1. Step 1

    Open the unprotected page in a basic text editor. Place the cursor where the link will appear.

  2. Step 2

    Type the following, substituting your own text or graphic: Click here to access the password protected page.

  3. Step 3

    Upload your file to the correct place in the file directory.

  4. Creating a Script for the Password Page

  5. Step 1

    Open a basic text editing program. Begin by typing the opening tags:

  6. Step 2

    Type the title of your page and close the title with a tag: Protected Page: Please enter password

  7. Step 3

    Type the following:

  8. Step 10

    Close the scripted section of the page by typing the follow: .

  9. Step 11

    Add a body section for browsers that do not read JavaScript: This page is designed for viewing with Firefox. Please upgrade your browser and return soon!

  10. Step 12

    Close the Web page by typing: Save the page (for this example, save it as "password.html").

  11. Creating the Error Page

  12. Step 1

    Open a basic text editing program. Begin by typing the opening tags: </p> </li> <li> <div class="stepBg">Step <span>2</span></div> <p>Title the page "Error" or "Wrong Password": <title>Sorry ' Wrong Password!

  13. Step 3

    Type the error message the viewer will see, such as:

    I'm sorry, the password you typed is incorrect.

  14. Step 4

    Give the user an opportunity to re-enter the password: Please click here to try again. This allows the user the opportunity to return to the password script.

  15. Step 5

    Allow the user to back out:

    Otherwise, click here to return to the main page. ("here.html" indicates the name of the page that links to the protected page)

  16. Step 6

    Close the page by typing the closing tags:

  17. Testing the Password Script

  18. Step 1

    Open a Web browser. Select Open from the File menu, locate the page that links to the password-protected page, and click Open to view it.

  19. Step 2

    Click on the link to the password-protected page.

  20. Step 3

    You will be prompted for the password. Make sure you enter it correctly; passwords are case-sensitive.

  21. Step 4

    Gauge the results. If it does not work, go back and double-check that you entered the script correctly.

  22. Finding More Complex Password-Protection Scripts

  23. Step 1

    Visit pages that offer free JavaScripts and do a search for "password". Many of these scripts are just cut and paste, with minimal changes.

  24. Step 2

    Protect extremely sensitive information by hiring a Web developer (or your ISP) to create a customized password script for you. These scripts are extremely sensitive and very difficult for hackers.

  25. Step 3

    Contact your Internet Service Provider and ask if they provide password protection services. This entails setting aside a portion of the server for your pages, so some ISPs may charge extra.

  26. Step 4

    If you use a free script, add a courtesy button or reference to the provider on your page.

  27. Step 5

    You may need to get permission before using JavaScripts from another Web site. When in doubt, ask!

  28. Step 6

    Not all browsers support scripts. Be sure to follow directions for providing alternates to scripts on your Web page.

Tips & Warnings
  • Try typing both the correct and incorrect passwords so you will see what your visitors see.
  • Do not link back to the password file (password.html). If the person does not know the password, they will be endlessly looped and cannot get out of the script.

Comments  

| View All 9 Comments

bokken134 said

Flag This Comment

on 3/23/2009 Large parts of this article seems to be missing in my browser.

suire said

Flag This Comment

on 12/5/2008 Guys try nosle. It works for me at http://grandtrunkexpress.com

http://www.nosle.com/loc/gth/sso/ssoview.jsp

Takumi86 said

Flag This Comment

on 11/22/2008 Mind to giving the original resources??

denmark said

Flag This Comment

on 3/11/2008 what happened to this article? parts are missing.

Flag This Comment

on 12/11/2006 Tried this on my website.

It DOES NOT work !!!!

Not sure why ...but when you type in any word instead of the password, the protected webpage still opens !!

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Demand Media
eHow_eHow Technology and Electronics