python cgi questions

DeepBlue DeepBlue at DeepBlue.org
Sun Dec 9 17:47:32 EST 2001


I have the following cgi python question.
I need to allow users to download  files through a series of HREF links.
But also I need to be able to update a database table when a user clicks on
the link.
So, each file to be downloaded is in its separate Form.  And each link has
an ONCLICK event that submits the form for the corresponding file.  When the
form is submitted I was hoping that the database is updated with values in
hidden fields in each form, and the user can download the file.
But, I can accomplish only one thing:  either the form is submitted or the
file is downloaded.
Can both things be accomplished:
1.  File is downloaded when link is clicked, and
2.  Form is submitted through onclick event in javascript
(onclick=document.form.submit)


Also, is it possible using a python script to submit a form in the
background without anything being returned to the browser?
In this case, I send the information via the python script (form submitted)
and the database is updated, but nothing is returned to the browser so that
the current page stays as is.
Thanks for any help or hints,
DB





More information about the Python-list mailing list