Guided Notes

Superglobals & Form Handling

$_GET, $_POST, $_SERVER and friends, processing forms, validating and sanitizing input, and preventing XSS.

Superglobals

Slide 1 / 5
SuperglobalHolds
$_GETQuery-string values: page.php?id=5
$_POSTForm fields sent with method="post"
$_REQUESTGET + POST + cookies (avoid — ambiguous)
$_SERVERRequest info: REQUEST_METHOD, HTTP_HOST, REMOTE_ADDR
$_FILESUploaded files
$_COOKIE / $_SESSIONCookies / session data
$_ENV / $GLOBALSEnvironment / all global variables
← Arrays