Page 272 -
P. 272
generate list
Display the list of athletes
Let’s create a program called generate_list.py which, when executed
by the web server, dynamically generates a HTML web page that looks
something like this:
It wouldn’t hurt to
add a title to this
web page, would it?
This is a paragraph.
Select an athlete from this list to work with:
Sarah
There’s one radio
button for each James
athlete. Julie All of this is
contained within an
Mikey HTML form.
Select
A “submit” button
When your user selects an athlete by clicking on her radio button and clicking
Select, a new web request is sent to the web server. This new web request
contains data about which radio button was pressed, as well as the name of a CGI
script to send the form’s data to.
Recall that all of your CGI scripts need to reside in the cgi-bin folder on
your web server. With this in mind, let’s make sure your generate_list.py
CGI script sends its data to another program called:
cgi-bin/generate_timing_data.py
236 Chapter 7