Skip to content

This is an advanced login script utilizing PHP and a flat file database. No SQL database is required.

Notifications You must be signed in to change notification settings

bakertaylor28/PHP-Advanced-Login-Script

Repository files navigation

PHP-Advanced-Login-Script

Password protect web pages by adding one line of PHP code to the page source. Script will show login form to protect content from unauthorized access. Includes login form, signup form, password reminder, and user management page for admin. Uses flat file database, no MySQL required. Can be set up to redirect after successful login.

Installation:

Update settings.php to match your needs (admin password, login form, signup form, and reminder form settings)
Upload password protector (all the files from the package) to your server
Set write permissions on users.php (users list file)
Open User Manager manager.php in your favorite browser (it will prompt for admin password from settings.php). You'll see:
    Logout link
    Protection string to be added at the top of each page you want to protect
    List of users (Username, Password, Email, Redirect URL)

How to protect a webpage:

Add protection string (available on User Management page) to each php page you would like to protect, at the very beginning of the page source (it must be the first line).
For example you want to protect page members-only.php.
    open source code of the members-only.php in your favorite editor
    add the protection string (see above on how to get the protection string) at the beginning

How to link to login form: You can add a link to login form from on any of your pages. If you saved password protector in "protect" folder on your server, sample html code for link would be: Login

How to link to signup form: You can add a link to signup form from on any of your pages. If you saved password protector in "protect" folder on your server, sample html code for link would be: Signup

How to link to password reminder form: You can add a link to password reminder form from on any of your pages. If you saved password protector in "protect" folder on your server, sample html code for link would be: Password Reminder

Note: login form, signup form, and password reminder form have its own header and footer templates. Find more information about password protector advanced on the forum.

About

This is an advanced login script utilizing PHP and a flat file database. No SQL database is required.

Resources

Stars

Watchers

Forks

Packages

No packages published