A typical CGI script
print "Content-type: text/html\n"
form = cgi.FieldStorage() # parse query
if form.has_key("firstname") and form["firstname"].value != "":
print "<h1>Hello", form["firstname"].value, "</h1>"
print "<h1>Error! Please enter first name.</h1>"