Section for Week 9, Tuesday, 3/9/99 1. MIDTERMS Return midterms, go over the answers: #1:

Please fill in this form

Your last name:
Your first name:
Are you a student? Yes No
#2: %form_data=&Get_Form_Data; if ($form_data{"lname"} =~ /\S/) { &CGI_Header("Followup"); print <<"EOF";
...
EOF &CGI_Ender; } else { [blank case] } #3: &CGI_Header; print <<"EOF";

Please fill in this form

Your last name:
Your first name:
EOF if ($form_data{'student'} =~ /yes/) { $syes="CHECKED"; $sno=""; } else { $syes=""; $sno="CHECKED"; } print <<"EOF" Are you a student? Yes No
EOF #4: a) lname=O%27Hara&fname=Betty+Sue&student=no b) @pairs=split(/&/, $query_string); foreach $pair (@pairs) { ($name, $value)=split (/=/, $pair); } #5: a) 1E90FF b) $ENV{"REQUEST_METHOD"} c) d) 1. flock FH, 2; (assuming the filehandle is ) 2. the second instance of the program will block until the first lock is released (or the file is closed, equiv). 2. CSS -- Cascading Style Sheets A style sheet is made up of style rules that tell a browser how to present a document. They can be given in two basic formats: a) Linked style sheets -- we won't discuss these too much. b) Embedded These always go inside the part of the HTML document. The TYPE="text/css" enables browsers to only accept certain style sheet formats (we will only be using the text/css type). Analogous to the "Content-type: text/html" string. Each rule is made up of a selector--usually an HTML element such as BODY, P, or EM--and the style to be applied to the selector. Basic format is: selector { property1: value1; property2: value2 } There are numerous specific properties that can be assigned -- see the web pages linked to from the prof's home page for the class. Basic intro + details at: http://www.htmlhelp.com/reference/css/