Interaction Using PHP

PHP is a programming language which runs on the server side and allows a web page respond to input. The reading for this is Chapters 3–6, pages 147–154 from chapter 7 (material about handling files on the server), and Ch. 11. We will also look at Ch. 12 if there seems to be time in the semester.

The official PHP documentation site is quite complete. I most often find myself in the function reference part.

A PHP program runs on the server and produces HTML output which is sent to the browser. The PHP code is in a file on the server located at some URL. The file generally contains a mixture of HTML and PHP. This file is fetched by the browser just as a regular HTML page, but the server doesn't send it directly. The PHP is executed on the server, and it outputs HTML. Then this output, along with the regluar HTML from the file, is sent to the browser, which sees a single HTML document. Since the PHP is run each time the page is fetched, the page can look different each time, and respond to various inputs, as we will see.