Python

  1. Home
  2. Computing & Technology
  3. Python

Part 1: Laying the Groundwork with HTML, CGI, and PHP

From Al Lukaszewski, for About.com

7 of 10

The Only Real HTML Page 2: The Menu as a Web Form

The latter half of the menu.html is as follows:

<font size="5" charset="iso-8859-1">
<form target="listing" method="post" action="./RSSReader.php">
<input type="submit" value="GET">
<select size=-"5" name="selection">
<option selected="Spiegel" value="Spiegel">Der Spiegel
Internat.</option>
<option value="Guardian"> Guardian World </option>
<option value="Python"> About Python </option>
<option value="Google"> About Google </option>
<option value="HomeRecording"> About Home Recording </option>
<option value="PHP"> About PHP </option>
<option value="Plussize"> About Plus-Size </option>
<option value="Terrorism"> About Terrorism </option>
<option value="Weather"> About Weather </option>
<option value="WebDesign"> About Web Design </option>
<option value="WebSearch"> About Web Search </option>
</select>
feed
</form>
</font>
</body>
</html>

The form tag here is straightforward for anyone who knows about HTML forms. If you need a refresher or a first-time tutorial, see Jennifer Kyrnin's tutorial on HTML forms.

The form data will be passed, for now, to RSSReader.php . However, it could just as easily pass to RSSReader.cgi ; it is a matter of preference and availability. As you know from my PHP-Javascript-Python tutorial , PHP makes a very customizable CGI replacement. It is not good for large applications, but here it is a helpful glue language.

The options listed in the HTML form are a few seed-feeds which I have included as examples. The value of each option listed in menu.html must match the name of the feed in our data file , which we will develop later.

Explore Python

About.com Special Features

Python

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.