CGI docs
Doru-Catalin Togea
doru-cat at ifi.uio.no
Fri Oct 25 05:03:15 EDT 2002
Hi!
Thanks for your links. I did do some research prior to posting my previous
message, and I did do some research after receiving some answers. I still
do not find what I am looking for.
I want to send parameters to my CGI programmes in the URL, not in any html
form. I am looking for a way to read in the parameters from the URL.
For example, I have the following link in a webpage:
<a href = "http://localhost/mhpp/hello.py?name='Catalin'">name</a>
I want my script "hello.py" to be able to pick up the
"name:Catalin" pair. The closest I came to finding a way to do it is the
"urlparse" function described, among other places, at
"http://www.python.org/doc/current/lib/module-urlparse.html".
An an example they say:
----------------------------------------------------------
urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
yields the tuple
('http', 'www.cwi.nl:80', '/%7Eguido/Python.html', '', '', '')
----------------------------------------------------------
Now, that's fine, but what do > I < pass as an argument to urlparse() in
my script? That is, which object contains the URL? It certainly isn't
sys.argv[0], which only gives the file name (with path).
In the example they KNOW the url, and just parse it. I DO NOT know my URLs
and I am asking for docs and / or code examples of the mechanisms which
can be used so that a script can know from which URL it has been called.
Anyone who can point me in the right direction?
Best regards,
Catalin
<skip>
> > Where do I find documantation for CGI scripting with Python? I am
> > particularly interested in how to get the arguments passed to the script
> > in an URL.
> >
> > Thanks in advance,
> > Catalin
<<<< ================================== >>>>
<< We are what we repeatedly do. >>
<< Excellence, therefore, is not an act >>
<< but a habit. >>
<<<< ================================== >>>>
More information about the Python-list
mailing list