Contact
Free PHP members area script to password-protect pages and downloads · Website Tools

LiteProtect.

Create a members area in minutes: protect any PHP page with two lines of code, serve private files to members only, and manage users and groups in an admin panel.

Free for personal and commercial usev1.0PHP 7.4+ no database
LiteProtect members login page
Free download

One ZIP file, 158 KB, with the full PHP source code and a README.

No database

Data is stored in protected files. Works on any PHP hosting.

Admin panel included

Modern, responsive admin with light and dark mode.

Combine with other Lite scripts

Same design, same admin and same core in every script.

What is LiteProtect?

Free PHP members area script to password-protect pages and downloads.

LiteProtect is a free members-area script for PHP. Add two lines to the top of any page and only signed-in members can see it; give members groups such as 'premium' to control who sees what. Files in the private folder are delivered through a download gateway that checks the login, so they cannot be reached by guessing the URL. Passwords are stored as bcrypt hashes, login attempts are limited, accounts can expire, and the admin panel keeps an access log of logins and downloads.

LiteProtect features

  • Protect any PHP page with two lines: require protect.php; lite_protect_require('group')
  • Members with groups (for example members, premium) for different access levels
  • Private downloads: files in the protected folder are served only to signed-in members, optionally per group
  • Bcrypt password hashing, session protection, login rate limiting and CSRF tokens
  • Account expiry dates, disable / enable accounts with one click
  • Access log of logins, failed logins and file downloads
  • Safe return-to-page after login, protected pages are never indexed by search engines
  • Light and dark admin, accent color picker, responsive login page
  • Flat-file storage: no MySQL, one-click data backup

LiteProtect screenshots

Real screenshots of LiteProtect: the public pages your visitors see and the admin panel you use to manage them.

LiteProtect members login page
Member login
LiteProtect admin dashboard with recent activity
Admin dashboard
LiteProtect admin members list with groups
Members and groups
LiteProtect instructions to protect pages with two lines of PHP
Protect pages in two lines

How LiteProtect works

  1. Add members in Admin > Members. Enter groups separated by commas, for example members, premium, and an optional expiry date.
  2. To protect a PHP page, add at the very top: require __DIR__ . '/lite-protect/protect.php'; $member = lite_protect_require(); (use lite_protect_require('premium') for a group).
  3. Upload files to the private folder and link to them with download.php?f=file.pdf. Only signed-in members can download them.
  4. Link your members to login.php. After signing in they return to the page they asked for. login.php?logout=1 signs out.
  5. Watch Admin > Access log for logins, failed attempts and downloads.

Install LiteProtect in 5 minutes

  1. Download LiteProtect.zip and unzip it.
  2. Upload the LiteProtect folder to your web hosting (FTP or file manager).
  3. Make the data and uploads folders writable.
  4. Open /admin/ in your browser and create your admin account.
  5. Click Add sample content in Settings, or start adding your own.

Requirements

  • PHP 7.4 or newer (PHP 8.x recommended)
  • Apache or nginx, any shared hosting
  • No MySQL: files in the data folder
  • README with full instructions is inside the ZIP

LiteProtect questions

Can members register themselves?

Not in this version: you add members in the admin panel. For public registration, paid memberships and more, see WebSiteAdmin or one of our community scripts.

Does it protect images or static HTML files?

Place them in the private folder and link through download.php, or turn an HTML page into a PHP page and add the two protection lines.

Need more than LiteProtect?

LiteProtect secures pages and files. To manage a complete website with pages, users, files and settings from one admin panel, take a look at WebSiteAdmin:

Explore WebSiteAdmin →

WebSiteAdmin

Our core content management system since 2003, and the foundation of most of our products. Fast, flexible and easy to use.

More free PHP scripts

Website Tools

LiteCookie

Add a GDPR-friendly cookie banner to any website with one line of code: accept, reject or choose categories, with optional scripts blocked until consent.

Website Tools

LiteNotes

A fast sticky-notes board for your own server: quick add, colors, tags, search and pinning. Share selected notes on a public page.

Website Tools

LiteTasks

Organise work on your own server: a kanban board with drag and drop, projects, priorities and due dates, plus an optional public roadmap.

Browse all 20 free PHP scripts or see our professional PHP scripts.