The web

The request and the response: form input, headers and status codes, cookies, sessions and a login, a JSON endpoint, PDO and file uploads with .htaccess rewrite rules.

043 Forms: GET and POST read GET and POST input and validate it safely Open 044 HTTP: headers and status codes send a header, set a status code, and redirect correctly Open 045 Cookies set, read and delete a cookie safely Open 046 Sessions session_start and $_SESSION, and the login state they keep Open 047 Login with sessions password_hash and password_verify on login, and pages guarded by a session Open 048 JSON REST endpoint a one-file endpoint that reads php://input and answers with JSON Open 049 Database with PDO PDO connect, SELECT and INSERT with placeholders, no injection by construction Open 050 Uploads and .htaccess uploads through the FILES array and clean URLs from rewrite rules Open

Lessons