My First CGI Script

Steve Holden sholden at holdenweb.com
Fri Apr 27 07:46:05 EDT 2001


"Jeff Shipman" <shippy at nmt.edu> wrote in message
news:3AE8F40D.64261D7 at nmt.edu...
> Ben Ocean wrote:
> > **How do I capture the data?
>
> What I normally do first is
>
> form = cgi.FieldStorage()
>
> That grabs all of the data from your form. Then, you
> can grab the individual components of your form by
> using it like a dictionary. (ie: form["name"], form["address"])
>
Ben, if you haven't used the cgi module's FieldStorage object before, I seem
to remember that form["name"] is not a simple string value but another
FieldStorage, so you access the value of the form element called "name"
using form["name"].value

regards
 Steve





More information about the Python-list mailing list