URL parameters (also called query strings) pass data directly in the URL after a ? character:
https://example.com/search?query=hello&page=2
The format is key=value pairs separated by &.
This form uses method="GET", which appends the data to the URL. Watch the address bar after you submit!
After submitting, your URL will look something like:
result.php?firstName=Alice&lastName=Smith&email=alice%40example.com&size=M
Notice that @ becomes %40 - this is URL encoding for special characters.
/search?q=web+development/products?page=3/catalog?category=books&sort=price/landing?utm_source=newsletter/report?format=pdf&year=2024<?php // URL: result.php?firstName=Alice&lastName=Smith // Access via $_GET superglobal array $firstName = $_GET['firstName'] ?? ''; // 'Alice' $lastName = $_GET['lastName'] ?? ''; // 'Smith' // Always sanitize before outputting! echo htmlspecialchars($firstName); ?>