|
home—lects—exams—hws
D2L—breeze (snow day)
This really makes it hit home: the server is getting a string(URL), and doing whatever it likes with that! If it returns a string of html, it's certainly compliant (and it can also return other things, like a 404 error. So as long as it returns any valid http response, then it's compliant).
Key Concept: Be sure to understand the three different things:We're used to the 2nd and 3rd items from Web I; the 1st item is adding yet another layer.
- The source of the .php program -- that's what is sitting on the server's computer.
- The characters that happen to get printed, when you run the program. That's what the server will send back to the client (browser); it's what you see if you choose Show Source in your browser. Hopefully these characters start with “<html>…” or so.
- The way that the browser choosed to render the characters it receives.
So:
upshot: So, the essence of the situation is that the server and browser are functions with the type-signatures:
server: stringurl → stringhtml
browser: stringhtml → void .
Client Server Browser ->request-> (URL) WebServer (Apache) - look up file: - possibly redirect... - what if file exists, but no permissions? - what if file doesn't exist? - what if URL is a directory? - what if request from a mobile platform? - process any php (as configured) which may invoke other programs, db connections, etc <-response<- (html, jpg, html+javascript, ...) Browser ...makes a gui window, lays out text/color/pictures Displays response Also: ...makes add'l URL requests... [Ad blocker!] ...runs javascript... ...invokes plug-ins or passes to OS...
A couple of choices made by web servers we care about:
For this class, you'll need a browser with good debug-tools built in. For Firefox, there is an extension “Firebug”; I'll demo a couple of Chrome's built-in tools. We will not worry about supporting old browers (e.g. old versions of IE).
≡ » More Tools » Developer Tools
We'll look briefly at the "Elements" tab, but today we're mostly concerned with the "Network" tab,
and clicking on particular files.
In particular, viewing the Request Headers and Response Headers.
Btw, here are the official HTTP response codes, or the cat-picture version.
the real upshot: So, the essence of the situation is actually that the server and browser are functions with the type-signatures:
server: http-request-packet → http-response-packet (where the first packet contains the URL, and the second packet contains the html response);
browser: http-response-packet → void .
Further things to mention (if not today, then perhaps later:)
home—lects—exams—hws
D2L—breeze (snow day)
©2015, Ian Barland, Radford University Last modified 2015.Sep.02 (Wed) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |