RU beehive logo ITEC dept promo banner
ITEC 325
2016fall
ibarland

homelectshws
D2Lbreeze (snow day)

forms
html input forms, and php

label tags

Testing forms

GET & POST methods

Q: But how is information communicated from a web form (pure html) to a php program?
A: When you click 'submit', the HTML makes a page-request to the page specified by the form's "action" attribute. (Presumably it's a php page.) The page-request incudes extra information about what html input fields had been selected, etc., as part of the http request. The server gets that request and invokes the php file as normal, but it also pre-initializes an array of values for the program — and it fills that array with the extra information contained in the page-request.

When to use which?:

takeaways


1 Note that everything the HTML designers bundled together under the input tag do have one thing in common: it's not allowed to have a body. I can see wanting to syntactically name which tags are forbidden a body and which allow one, but that still doesn't explain why each input-type isn't its own tag, which would then make all input tags treated equally.      

2 Idempotent is not quite the same as having-no-side-effect: For example, if you add-to-shopping-cart-unless-item-already-there, you can change state, but still be idempotent.      

3 Well, “irrelevant” state-change is okay: you can update log files and update cookie-timestamps, w/o violating the spirit of a GET request.      

4 And later, when we talk about sticky-forms, I'll suggest “customer-info-edit.html” which requires either …-form or …-handle.      

homelectshws
D2Lbreeze (snow day)


©2016, Ian Barland, Radford University
Last modified 2016.Sep.21 (Wed)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.