| Password Protection |
What this script does:
Once you entered your password, it promted you to:
For example, I entered the password 'apple'. This generated the number 239552 and prompted me to create a page called 'apple.html'. It is important that the extension on the file is .html not .htm 3) Next, create the page with the information you would like to protect. In my case, I will create the page apple.html Note: If the page you would like to protect is already created, then you must rename the page and use the password as the new filename. 4) You will need to download the file password.html (right-click and Save Target As...) and save it into your website in the same directory(folder) as your protected page. Note: Be sure that when you save the file password.html it is saved as a .html file, not as a .htm file. Note: To protect multiple pages, each page and its version of the password file must be in seperate folders, or you must change the name of the password file (rename "password.html" to "password2.html"). Now that you have your password created, the number written down, your protected page created, and the password.html file saved, it is time to work on the code required to implement the password protection. 5) Open password.html for editing and search the code until you find the section that reads: if(code==239552) // code==[your access code] 6) Replace the number
in red with the number that you generated earlier. Save the
changes you made to the code then open the page you will use to link
to your protected information. 7) Create a link, for example 'Members Only', and link it to the page you downloaded (password.html) Once you have placed the link where you like you are finished! You have just created a password protected webpage! Note: If you are protecting multiple pages, be sure that your link is to the password.html file in the correct folder (if you are using multiple folders) or to whatever you renamed the file to (for example, password2.html). |