Free Script to Secure Your PHP Application

Free Script to Secure Your PHP Application

Lightweight solution to secure PHP pages with a password that is stored in the source file. No database needed at all! It is an easy solution to quickly secure pages when you don’t need strong authentication. Installable in less than a minute!

How to install IZP?

1. Copy-paste “izp.php” file into the folder of your choice, within your web project

2. Open the PHP file that you want to protect

3. At the header (before any visual display), insert the following snippet :

require_once(“folder/izp.php”);

4. “folder” refers to the folder where the script is located, specify the correct one in your case!

5. Done! Your page page is now protected with IZP

How to configure IZP?

1. Open “izp.php”

2. Customize the value of the variable “$PROTECTION_PASSWORD” by typing desired password

3. Customize the values of the variables “$SUCCESS_REDIRECTION_PATH” and “$DIRECT_ACCESS_REDIRECTION_PATH” by indicating, respectively, the file to execute if the entered password is correct, and, redirection path in case of direct accessing to the izp file, or voluntary logout.

A few more information…

1. When the password is valid, a cookie named “izp” is created: this cookie will be considered as the authorization “token” until it dies. Without this cookie, IZP cannot know if you are an authenticated user and therefore asks you a password.

2. By default, the “izp” cookie has a lifespan of 24 hours.

3. Use a GET request to reset the authentication status (cookie deletion): “izp.php?logout”