[Tutor] how to add multiple strings..

Lloyd, Jamie LloydJ@missouri.edu
Sat, 5 May 2001 03:41:36 -0500


Here is my beginning html code..

<html><head><title>Jamie's hello program</title></head>
<body bgcolor="#888888">
<center>
Jamie's hello program
<p>
<form action="http://oper-test.telecom.missouri.edu/cgi-bin/jamie/hello.cgi"

method="post">
<input type="radio" name="sir" value="Mr">Mr
<input type="radio" name="sir" value="Ms">Ms
<p>
Please enter your name:<br>
<input size=25 name="name" value="">
<p>
<input type="submit" name="submit" value="submit">
<input type=reset value="Clear">
</form>
</center>
</body></html>

and this is my python script for doing it..

#!/usr/bin/python

import cgi, os, sys

print "Content-type: text/html\n\n"
print "<html><head><title></title></head><body>"
form = cgi.FieldStorage()
name = form["name"].value
sir = form["sir"].value
if not form.has_key("name") or form["name"].value == ""
  print "<a
href=""http://oper-test.telecom.missouri.edu/hello_jam.html"">You did not
enter your name, click to go back!</a>"
else:
   print "<H1>Hello " + sir + ". " + name + "</h1>"

print "</body></html>"

The script prints the name, but it does not print Mr. or Ms. before the name
even though you select the bullet in the html code?  Could someone please
help me?

Thanks in advance!
Jamie