Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to get CGI request-URL

Reply
Thread Tools

How to get CGI request-URL

 
 
Hallvard B Furuseth
Guest
Posts: n/a
 
      07-04-2003
How can I get the URL the user typed (except the part after '?') with
the cgi module?

I expect the 'Host:' HTTP header + os.environ['SCRIPT_NAME'] would do
it, but I don't see how to find the Host header. The www server has
several names, so I can't just use the default host name.

--
Hallvard
 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      07-04-2003
Hallvard B Furuseth wrote:
>
> How can I get the URL the user typed (except the part after '?') with
> the cgi module?
>
> I expect the 'Host:' HTTP header + os.environ['SCRIPT_NAME'] would do
> it, but I don't see how to find the Host header. The www server has
> several names, so I can't just use the default host name.


This might help: http://hoohoo.ncsa.uiuc.edu/cgi/env.html

Found via Google....
 
Reply With Quote
 
 
 
 
Gilles Lenfant
Guest
Posts: n/a
 
      07-04-2003
"Hallvard B Furuseth" <h.b.furuseth(nospam)@usit.uio(nospam).no> a écrit
dans le message de news: http://www.velocityreviews.com/forums/(E-Mail Removed)...
> How can I get the URL the user typed (except the part after '?') with
> the cgi module?
>
> I expect the 'Host:' HTTP header + os.environ['SCRIPT_NAME'] would do
> it, but I don't see how to find the Host header. The www server has
> several names, so I can't just use the default host name.
>
> --
> Hallvard


Don't remember but...

There's a test() function in the cgi module that shows the special data
available from a CGI script.

--Gilles

 
Reply With Quote
 
Irmen de Jong
Guest
Posts: n/a
 
      07-05-2003
Hallvard B Furuseth wrote:
> Thanks for the answers.
>


Glad to be of assistance, but you didn't tell us what the
actual solution to your problem was... It is always a good idea
to do so because others that have the same problem, and
reading the thread, can immediately benefit

--Irmen

 
Reply With Quote
 
Hallvard B Furuseth
Guest
Posts: n/a
 
      07-05-2003
Irmen de Jong wrote:
> Glad to be of assistance, but you didn't tell us what the
> actual solution to your problem was... It is always a good idea
> to do so because others that have the same problem, and
> reading the thread, can immediately benefit


Good point. I'll come back when I'm sure my solution actually works...
I need to get someone to intall the program first.

--
Hallvard
 
Reply With Quote
 
Hallvard B Furuseth
Guest
Posts: n/a
 
      07-18-2003
Irmen de Jong wrote:

> Glad to be of assistance, but you didn't tell us what the
> actual solution to your problem was...


'https://' + os.environ['SERVER_NAME'] + os.environ['REQUEST_URI']

--
Hallvard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
(CGI-Target)Could not connect to CGI-Proxy John Smith Java 0 05-15-2006 09:21 PM
Python CGI - Accepting Input, Invoking Another Process, Ending CGI LarsenMTL Python 4 11-04-2004 05:59 PM
Calling cgi from cgi thru 'system' function. Different behaviour on browser v/s cmd line Shailan Perl 2 12-15-2003 04:26 PM
Re: CGI Perl "use CGI" statement fail Jürgen Exner Perl 0 07-31-2003 02:00 PM



Advertisments