CGI: how to get referer header?

nihilo exnihilo at NOmyrealCAPSbox.com
Sat Mar 22 07:07:09 EST 2003


I am trying to get the referer and user agent headers in a cgi program 
I'm writing. I haven't been able to find any clear information on how to 
do this, but I've been trying the following:

referer = cgi.parse_header('Referer')
agent = cgi.parse_header('User-Agent')

The values of these variables after assignment are:

"('referer', {})"
"('user-agent', {})"

Why are the dictionaries empty?

thanks for any help...





More information about the Python-list mailing list