A PHP and MySQL task-management web application built for local use with XAMPP. TaskFlow lets users register, log in, manage their own tasks, mark tasks complete, undo completion, edit task details, and delete tasks from a simple dashboard.
TaskFlow is a full-stack PHP/MySQL CRUD application with user authentication, session-based access control, PDO database queries, and user-specific task management. It demonstrates practical backend workflow, database design, secure password hashing, and a clean project structure suitable for local deployment with XAMPP.
Many students and small teams need a simple way to track daily tasks without using a large project-management platform. This project solves that problem by providing a lightweight web app where each user can create an account and manage only their own tasks.
- User registration with basic validation.
- Secure password hashing with PHP
password_hash(). - User login with
password_verify(). - Session-based authentication.
- Logout flow that clears the active session.
- User-specific task dashboard.
- Create, read, update, delete task workflow.
- Mark tasks as complete and undo completion.
- Optional task description, category ID, and due date fields supported by the task model.
- Centralized database connection through
src/db.php. - PDO prepared statements for database access.
- PHP
- MySQL
- PDO
- HTML
- CSS
- XAMPP
- Apache
- phpMyAdmin
Task-Management-System/
|-- README.md
|-- src/
| |-- index.php
| |-- register.php
| |-- dashboard.php
| |-- add_task.php
| |-- edit_task.php
| |-- delete_task.php
| |-- complete_task.php
| |-- logout.php
| |-- db.php
| `-- db_test.php
|-- assets/
| |-- css/
| |-- images/
| `-- js/
|-- screenshots/
|-- docs/
|-- sql/
| |-- schema.sql
| `-- sqltable.txt
TaskFlow uses a traditional server-rendered PHP architecture:
- The browser sends requests to PHP pages in
src/. - Pages that need database access include
src/db.php. src/db.phpstarts the PHP session and creates the PDO MySQL connection.- Authentication data is stored in
$_SESSION. - Task pages use the logged-in user's session ID to load or modify only that user's tasks.
- MySQL stores users, categories, and tasks.
The app expects a MySQL database named todo_app.
Main tables:
users: stores account details and hashed passwords.categories: stores optional task categories such as school, work, or personal.tasks: stores user tasks, descriptions, category links, due dates, completion timestamps, and creation timestamps.
The import file is available at:
sql/schema.sql
src/db.phpstarts the session and creates the PDO connection.src/index.phphandles login and redirects authenticated users to the dashboard.src/register.phpvalidates registration input, hashes the password, and inserts a new user.src/dashboard.phpchecks the active session and loads tasks for the current user.src/add_task.phpinserts a new task for the logged-in user.src/edit_task.phploads an existing task, checks ownership, and updates it.src/complete_task.phpsets or clears the completion timestamp.src/delete_task.phpdeletes a task only when it belongs to the logged-in user.src/logout.phpclears the session and returns the user to login.
- A new user registers with username, email, password, and password confirmation.
- The password is hashed before being saved to the
userstable. - During login, the submitted email is used to find the user record.
password_verify()checks the submitted password against the saved hash.- On successful login, the app stores the user's ID, username, and email in the session.
- Protected pages redirect unauthenticated users back to
src/index.php. - Logout clears and destroys the session.
| Operation | File | Description |
|---|---|---|
| Create | src/add_task.php |
Adds a task for the logged-in user. |
| Read | src/dashboard.php |
Displays all tasks owned by the current user. |
| Update | src/edit_task.php |
Updates task title, description, category, and due date. |
| Complete/Undo | src/complete_task.php |
Marks a task complete or restores it to incomplete. |
| Delete | src/delete_task.php |
Deletes a task owned by the current user. |
Download and install XAMPP for your operating system.
Open the XAMPP Control Panel and start:
- Apache
- MySQL
Copy or clone this repository into the XAMPP htdocs folder.
Example folder path:
C:\xampp\htdocs\Task-Management-System
- Open phpMyAdmin at
http://localhost/phpmyadmin. - Create a database named
todo_app. - Select the
todo_appdatabase. - Open the Import tab.
- Choose
sql/schema.sql. - Click Import.
The default database connection in src/db.php is:
$DB_HOST = '127.0.0.1';
$DB_NAME = 'todo_app';
$DB_USER = 'root';
$DB_PASS = '';These settings match the default local XAMPP MySQL setup.
Visit:
http://localhost/Task-Management-System/src/index.php
- Keeping user sessions consistent across multiple PHP pages.
- Making sure users can only view, update, complete, or delete their own tasks.
- Centralizing the database connection so every page uses the same PDO setup.
- Designing table relationships between users, tasks, and optional categories.
- Separating completed and incomplete task state using timestamps.
- Improve the visual design with a shared stylesheet.
- Add search and filtering for tasks.
- Add priority levels for tasks.
- Expand category management beyond fixed category IDs.
- Add password reset and email verification.
- Improve form feedback for validation errors.
- Add automated tests for authentication and task workflows.
- How to connect PHP to MySQL using PDO.
- How to use prepared statements for safer database queries.
- How PHP sessions protect authenticated pages.
- How to hash and verify passwords correctly.
- How CRUD operations map to separate backend workflows.
- How to structure a small full-stack project for clearer presentation.