1 Home
stak administrator edited this page 2026-09-10 11:41:34 +00:00

PHP Login & Role Management System — Wiki

A lightweight, framework-free PHP foundation for authentication and role-based access control: central routing, login, self-registration with an admin-approval workflow, profile self-service, and a small admin panel for managing users. Built with plain PHP, PDO/MySQL and water.css — no external dependencies.

Pages in this wiki

  • Installation — setting up the project in XAMPP, creating the database and the first administrator
  • Architecture — request flow, folder structure, how the router and the base-path detection work
  • Roles and Routing — the role system, config/routes.php, and how access control is enforced
  • Adding a New Page — step-by-step guide for extending the app with a new route
  • Admin Guide — how to manage users as an administrator
  • Troubleshooting — common errors and their causes

Quick facts

Language PHP (no framework), plain HTML
Database MySQL, accessed via PDO
Styling water.css via CDN, no custom CSS
Roles pending, role1, role2, role3, admin
Entry point index.php (front controller)
DB setup single file: sql/database.sql

Default request flow

Browser request
      │
      ▼
.htaccess  ──►  index.php  ──►  app/router.php  ──►  pages/*.php
 (rewrite)      (front         (matches URL          (renders the
                 controller)    against routes.php,    actual page)
                                checks login/role)

See Architecture for details.