Data, network and security

The data layer and the network, then the attacks a public page has to survive: PDO transactions and fetch modes, cURL, XML and CSV, hardened sessions, password hashing, XSS and CSRF, SQL injection, and mail.

087 PDO transactions group writes in a transaction, commit, and roll back on failure Open 088 PDO fetch modes fetch rows as arrays, as objects, and as a single column Open 089 cURL requests a cURL handle, its options, and the error check after the call Open 090 Parallel cURL many URLs at once with a cURL multi handle and a run loop Open 091 XML with SimpleXML and DOM SimpleXML, XPath queries, and safe documents from DOMDocument Open 092 CSV files fgetcsv and fputcsv, streaming a large file row by row Open 093 Harden sessions safe cookie params, id rotation, and simple theft detection Open 094 Password hashing password_hash, password_verify, and an upgrade that keeps old hashes Open 095 XSS and CSRF output escaping against XSS, tokens and SameSite cookies against CSRF Open 096 SQL injection defense prepared statements, safe LIKE patterns, and integer LIMIT values Open 097 Send email simple mail, safe headers, and a queue instead of a blocking request Open

Lessons