FormsandCGIMechanism

FormsandCGIMechanism - Lecture Forms and Common Gateway...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CGI Copyright © Ellis Horowitz 1999-2010 1 Lecture Forms and Common Gateway Interface Mechanism
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGI Copyright © Ellis Horowitz 1999-2010 2 Forms • Used to create a set of pages that contain fields in which the viewer can select and supply information – Introduced in HTML 2.0 – Allows WWW users to perform data entry – Permit direct interaction with customers for inquiries, registration, sales of products, and services – To create a capability requires two steps: • Use HTML form elements to create the pages that contain the form • Write a server-side script to process form data; this program must be placed so the WWW server can execute it
Background image of page 2
CGI Copyright © Ellis Horowitz 1999-2010 3 Summary of User Interface Elements <INPUT> <TEXTAREA> <SELECT> Text Checkbox Radio button Submit Reset Password submit reset **** File Browse Red Red Green Blue
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGI Copyright © Ellis Horowitz 1999-2010 4 FORM Element Syntax<FORM> ... </FORM> Attribute Specifications – ACTION= URI (form handler) – METHOD=[ get | post ] (HTTP method for submitting form) • GET is the default; form contents are appended to the URL • POST causes the fill-out form contents to be sent in a data body as standard input – ENCTYPE= ContentType (content type to submit form as) • Defaults to application/x-www-urlencoded which returns name/value pairs, separated by &, spaces replaced by + and reserved characters (like #) replaced by %HH, H a hex digit – ACCEPT-CHARSET= Charsets (supported character encodings) – TARGET= FrameTarget (frame to render form result in) – ONSUBMIT= Script (form was submitted) – ONRESET= Script (form was reset) – common attributes
Background image of page 4
CGI Copyright © Ellis Horowitz 1999-2010 5 <INPUT> Tag • Used inside the <FORM> tag to specify a data-entry object • Has 19 attributes, here are a few – TYPE: What kind of input the user will supply (default is TEXT) – NAME: Name of data entry object whose value the user will supply – VALUE: Required for radio and checkboxes – CHECKED: For radio buttons and checkboxes – SIZE: Specific to each type of field – MAXLENGTH: Limit on accepted characters – SRC: Image file used as a graphical submit button when TYPE=IMAGE – DISABLED unavailable in this context – READONLY for text and passwords
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGI Copyright © Ellis Horowitz 1999-2010 6 <INPUT> Tag(cont’d) •TYPE:[CHECKBOX FILE HIDDEN IMAGE PASSWORD RADIO RESET SUBMIT TEXT] •CHECKBOX: A single value, on/off; each generates name/value pair <INPUT TYPE=CHECKBOX CHECKED NAME="MARRIED" VALUE="yes"> •FILE: Users attach a file to the form contents; a text field holds the file name and a button permits browsing <INPUT TYPE=FILE NAME="banner" ACCEPT="image*"> •HIDDEN: The field is not rendered, so servers can maintain state information <INPUT TYPE=HIDDEN NAME="BANKACCT" VALUE="A057-23- 789">
Background image of page 6
CGI Copyright © Ellis Horowitz 1999-2010 7 <INPUT> Tag(cont’d) • IMAGE: Used for graphical submit buttons <INPUT TYPE=IMAGE SRC="banner.gif"
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2011 for the course CSCI 571 at USC.

Page1 / 61

FormsandCGIMechanism - Lecture Forms and Common Gateway...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online