Skip to main content

Recently Updated Pages

Adding Role-Based Access Control

PHP and MySQL Login Systems

Role-based access control allows authenticated users to perform only the actions permitted by the...

Updated 1 month ago by Mr Napper

Creating a Logout Page

PHP and MySQL Login Systems

Logout should remove server-side session data, expire the session cookie and return the user to a...

Updated 1 month ago by Mr Napper

Protecting Pages and Preventing Unauthorised Access

PHP and MySQL Login Systems

A protected page checks authentication on the server before sending restricted content. Hiding a ...

Updated 1 month ago by Mr Napper

Using PHP Sessions to Keep Users Logged In

PHP and MySQL Login Systems

PHP sessions store a small amount of trusted server-side state between requests. A login system c...

Updated 1 month ago by Mr Napper

Creating a Login Form

PHP and MySQL Login Systems

This standalone login page validates credentials with PDO, starts a secure session and redirects ...

Updated 1 month ago by Mr Napper

Creating a User Registration Form

PHP and MySQL Login Systems

This standalone registration page accepts a fictional username and password, validates both on th...

Updated 1 month ago by Mr Napper

Secure Password Storage with Password Hashing

PHP and MySQL Login Systems

Password hashing converts a password into a one-way value suitable for storage. PHP automatically...

Updated 1 month ago by Mr Napper

Exporting Processed Data to CSV

Working with Data Processing and Presenting Imported Data

CSV export can support download and reuse of a filtered or processed result. It is optional when ...

Updated 1 month ago by Mr Napper

Creating Charts from Processed SQL Data

Working with Data Processing and Presenting Imported Data

A chart is useful only when it makes a comparison or pattern easier to understand. JavaScript is ...

Updated 1 month ago by Mr Napper

Creating Match and Player Views

Working with Data Processing and Presenting Imported Data

A detail view lets a user move from a summary to the record needed for a task. Receive a validate...

Updated 1 month ago by Mr Napper

Calculating Summary Statistics

Working with Data Processing and Presenting Imported Data

Statistics reduce a dataset to information users can interpret. SELECT COUNT(*) AS result_count...

Updated 1 month ago by Mr Napper

Building a Leaderboard

Working with Data Processing and Presenting Imported Data

A leaderboard converts stored results into a ranked, understandable output. SELECT team_name, ...

Updated 1 month ago by Mr Napper

Querying Data for a User Need

Working with Data Processing and Presenting Imported Data

A query is meaningful when it answers a user question. Begin with the need, then choose fields, f...

Updated 1 month ago by Mr Napper

Testing an Admin CSV Import

Working with Data Importing CSV into MySQL with PHP

Testing must cover permissions, validation, database effects and feedback. Test Condition Expecte...

Updated 1 month ago by Mr Napper

Building a Complete Admin CSV Import

Working with Data Importing CSV into MySQL with PHP

A complete import combines access control, upload checks, parsing, row validation, prepared state...

Updated 1 month ago by Mr Napper

Reporting CSV Import Results

Working with Data Importing CSV into MySQL with PHP

An administrator needs evidence of what happened, not just “upload complete”. Report useful total...

Updated 1 month ago by Mr Napper

Inserting Imported Rows Safely

Working with Data Importing CSV into MySQL with PHP

Prepare the insert once, then execute it for each valid row. $insert = $pdo->prepare( "INSERT...

Updated 1 month ago by Mr Napper

Validating CSV Rows

Working with Data Importing CSV into MySQL with PHP

Validate every row before storing it. if (count($row) !== 4) { $rowErrors[] = "Row $rowNumber...

Updated 1 month ago by Mr Napper

Reading CSV Rows with fgetcsv

Working with Data Importing CSV into MySQL with PHP

Use PHP’s CSV parser so quoted commas and escaped values are handled correctly. $handle = fopen($...

Updated 1 month ago by Mr Napper

Validating an Uploaded CSV File

Working with Data Importing CSV into MySQL with PHP

Validate the upload before reading its rows. $file = $_FILES["dataset"] ?? null; $errors = []; if...

Updated 1 month ago by Mr Napper