urllib ??

Alan Kennedy alanmk at hotmail.com
Tue Nov 5 08:38:46 EST 2002


Rainer wrote:

> with the help of alan, we finally have the solution for this problem:
> 'Submit', 'Process query'),
> has to be set as a name/value pair....
> this is it

Just to make it explicitly clear, for archival purposes, the reason why
the form submission was failing was because the processing script seemed
to be checking the value of the "submit" button on the form.

Submit buttons on forms are considered to be form fields, like any other
field. When the user submits a form using a submit button, the button
which was pressed is considered to be "successful", and a name/value
pair is added to the form data for that button.

In the case of Rainer's script, the returned HTML contained the
following submit field definition

<input type="submit" name="Submit" value="Process query" />

Whenever the form was submitted using that button (in a browser), the
name value pair

Submit=Process query

was added to the POSTed form data. The processing script was expecting
to receive that name/value pair, and when it didn't, it simply returned
the HTML for the form, without doing any further processing.

Modifying Rainer's script to include the name/value pair for the submit
button solved the problem.

--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan



More information about the Python-list mailing list