CGI - client information

Martin v. Löwis martin at v.loewis.de
Sun Jan 5 11:05:55 CET 2003


jolsen at mailme.dk (Jesper Olsen) writes:

> Is it possible from a python cgi script to query the web server
> about the IP address of the client that is calling the script?

It is not possible to perform queries to the Web server in a CGI
script. The server provides a set of information, and invokes the
script. The script then has no bidirectional channel to the server.

> E.g. the web server could provide this info in an environment
> variable.

You should read the CGI spec. REMOTE_ADDR might do what you want.

Regards,
Martin




More information about the Python-list mailing list