Products > HTML Password Lock

HTML Password Lock FAQ

Password protection:

Where is my original HTML file? I tried opening the protected HTML file, but all I get is the locked info!
How to unlock files with the software?
How to edit the locked file? Can't I edit it anymore?
How to add, delete, and modify the valid user/password list?
How can I use the software to protect multiple HTML pages, directories, or entire websites?
How to retrieve the current login username, and display it?
How to add a logout function?
The "Back" button of the web browser does not work on the locked page. How to fix this problem?

Where is my original HTML file? I tried opening the protected HTML file, but all I get is the locked info!

After protection, the file with the original file name will be protected, and the original un-protected file will backup as *.PreLock at the same directory.

For instance, a file named "c:\test\member.htm" will be protected under the same name, and the original unprotected file will be saved as "c:\test\member.htm.PreLock".

To unlock the file, you can delete the file "c:\test\member.htm", and rename the file "c:\test\member.htm.PreLock" to "c:\test\member.htm".  You can also do this with the software. Please refer to the FAQ: How to unlock files with the software?

Suggestion:
Please backup your original file(s) carefully, such as in a backup directory. Or you can copy your HTML file(s) to a new directory, and lock the HTML file(s) in that new directory. This way, you avoid the unlocking process to get your unprotected file(s) back.

How to unlock files with the software?

After protection, the file with the original file name will be protected, and the original unprotected file will be backed up as *.PreLock at the same directory. You can use the software to unlock files from the backup files.

1. In step 1, choose "Un-lock from backup files", and add the protected file to the file list.

Unlock from locked file

2. In step 2, click on the "Un-lock" button.

Suggestion:
Please backup your original file(s) carefully, such as in a backup directory. Or you can copy your HTML files to a new directory, and lock the HTML files in the new directory. This way, you avoid the unlocking process to get your unprotected files back.

How to edit the locked file? Can't I edit it anymore?

You can't modify the locked file directly.

To edit if, first unlock the locked file (please refer to How to unlock files with the software?) After editing the file, you can password protect the file with the software, and upload the protected file to your web server once again.

How to add, delete and modify the valid user/password list?

You can't change the valid user/password by directly modifying the locked file. To add, delete or modify the valid user/password list, please launch the software, load the .prj file and edit the user/password list in step 2. You must then lock the file(s) with the new user/password list again.

How can I use the software to protect my multiple HTML pages, directories or entire websites?

In step3, select "Session" or "Cookie" as protection type. You can use HTML Password Lock to protect your entire website with the same password.  

HTML Password Protection Type

For "Session" and "Cookie" protection types, when the user first launches your website, a password will be needed. If the password is inputcorrectly, it will be stored on the user's local machine as cookies. When the user opens another locked web page on your website, the locked web page will first check the cookies to find the password. So if your website has multiple web pages locked with the same password, only the first locked web page will need a password, the others will automatically check cookies to find correct password.  
For the "Session" protection type, the cookie with the password will be destroyed after closing all web browsers.
For the "cookie" protection type, the cookie with the password will be saved for 365 days by default.

How to retrieve the current login username?

This document will show you how to retrieve your current login username, so you can display a welcome message for the login user, fill the username into an input box or get more information about the user.

How does it work?

To retrieve username information, the protection type (in step 3) must be "Session" or "Cookie". After the user logs in, the username info is stored in the cookie. Then, you can use a JavaScript script to retrieve the username from the document cookie.

How to do it?

Use the following JavaScript scripts to retrieve a username from the cookie. The scripts should be placed in the protected web page (before the protection), or any other web page that the logged-in user will access.

The function getusername will return the current login username.

Online example

This example will display a welcome message for the current user:

http://www.mtopsoft.com/htmllock/example3.htm

This example will fill the current username to a text box:

http://www.mtopsoft.com/htmllock/example4.htm

How to add a logout function?

In "Session" mode, the password protection uses a "session cookie" to store user and password information for the current session. You can add a logout click-on button to log out the current logged-in user.

Single password mode:

Source code of logout:

Below is the source code of a "logout" link:

User/password mode:

Source code of logout:

Below is the source code of a "logout" link:

The "Back" button of the web browser does not work on the locked page. How to fix this problem?

By default, the "Back" button will not work on a locked page. To enable this button, when locking the HTML file, in step 3, "Advanced options", please uncheck the "Decrypting in the body OnLoad function" option.

 

Search This Site:

   Advanced

Main

HTML Password Lock
Screenshots
Order Now!
  Download Now

Help

Online Help
Quick Start
FAQ

Online Example

Single Password
Multi-Users/Passwords

Related Products

Search Engine Composer
Web Button Menu Maker

Who likes our products:

Rated 4.5 stars at SnapFiles

Pop at Cnet Download.com

Rated 5 Stars at The File Transit!

 
Home | Download | Order Now | Contact us | Links
ęCopyright Mtopsoft.com All Rights Reserved.