Password Protecting Your Website

Below are simple instructions to password protecting a website. While not the most secure means of password protection, this method provides reasonable security for files such as course materials. You may wish to print these instructions for easy reference since you will be working with three programs: your browser (e.g. Internet Explorer), Notepad, and FrontPage.

Here is an example of what you are going to create.

Follow these steps to create your own password protection.

  1. Open Notepad [generally found under Start button/Accessories in a Windows PC environment].
  2. Returning to your browser window, Select and Copy the information below:<HTML>
    function passWord() {
    var testV = 1;
    var pass1 = prompt(‘Please Enter Your Password’,’ ‘);
    while (testV < 3) {
    if (!pass1)
    if (pass1.toLowerCase() == “cucumber“) {
    alert(‘You Got it Right!’);‘index.htm‘);
    var pass1 =
    prompt(‘Access Denied – Password Incorrect, Please Try Again.’,’Password’);
    if (pass1.toLowerCase()!=”password” & testV ==3)
    return ” “;
    <input type=”button” value=”Enter Protected Area” onClick=”passWord()”>
  3. Returning to Notepad, paste the copied text into the window.
  4. Delete the password cucumber in line 10 (highlighted in yellow above) and replace it with one of your own.
  5. Likewise, change the highlighted target page filename in line 12, index.htm, to the filename of the web page you wish to password protect. [Always delete carefully — leave all other characters, including the single quote marks, which will enclose your new password. If your initial attempt to use a password fails, carefully compare your edited code lines to the original lines of source code to check for accidental deletions, add what is missing, and try again.]
  6. Save this Notepad document in your web site’s folder, but save it as an html file by adding .htm or .html to the filename, instead of .txt (e.g. code.htm).
  7. Open Microsoft FrontPage. [If a blank page does not automatically open, click on New under the File menu, and select Page or Blank Page, depending on your version of FrontPage.]
  8. Select Save As under the File menu; when the Save As box appears, select your web site folder from the drop-down Save-In menu.
  9. Name the file by typing a short but descriptive title in the File name box. [If you use more than one word for your file name, use underscores instead of spaces (example: art_index). FrontPage will supply the .htm extension to the filename, so that the example becomes art_index.htm.]
  10. Save the file.
  11. Select the HTML button located near the bottom of the screen.
  12. Delete all the code text in the HTML view.
  13. Returning to your Notepad document, Select and Copy the entire text of your Notepad document.
  14. Returning to the blank FrontPage html view, Paste this text into the blank HTML view.
  15. Save the new page.
  16. Return to Normal FrontPage view [use button preceding HTML at bottom]. You will see a button that reads “Enter Protected Area.”
  17. Begin customizing your page.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.