How to call functions inside a cgi script from the html interface?

Jiri Baum jiri at baum.com.au
Sun Jun 2 04:17:38 EDT 2002


Ken:
> How to call functions inside a cgi script from the html interface?

> Eg. If there is a link on the html display call "Search", how do I get it
> to call the function call "def search( )" inside the cgi script?

You need to get yourself a CGI programming reference, or even a good HTML
book, and refer to them before you post questions on the (wrong) newsgroup.

Also read the docs for the python cgi module (eg at www.python.org).

HTTP doesn't have any facilities for doing this directly. Every time a user
selects a link, a request is made to the server for that page. This can
either be a completely different cgi script, or it can be the same script
with different parameters. Either way, it's a separate connection, so don't
expect variables to stay.


Jiri
-- 
Jiri Baum <jiri at baum.com.au>           http://www.csse.monash.edu.au/~jirib
  MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools



More information about the Python-list mailing list