Re: Get parameters from URL using CGI

2006-02-19 Thread John Zenger
import cgi import cgitb; cgitb.enable() # Optional; for debugging only print "Content-Type: text/html" print f = cgi.FieldStorage() for i in f.keys(): print "",i,":",f[i].value abcd wrote: > i want to create a CGI script which simply prints out values given via > the URL (such as when a GE

Re: Get parameters from URL using CGI

2006-02-18 Thread abcd
Ian Leitch wrote: > >>> from urlparse import urlparse > >>> dict([n for n in [i.split('=') for i in > urlparse('http://www.somesite.com/cgi-bin/foo.cgi?name=john&age=90')[4].split('&')]]) > {'age': '90', 'name': 'john'} Ian, thanks for the reply, but that is not what I need to do. Inside foo.cg

Re: Get parameters from URL using CGI

2006-02-18 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 abcd wrote: > i want to create a CGI script which simply prints out values given via > the URL (such as when a GET is performed). > > So if I have a script named, foo.cgi and I access it by going to: > > http://www.somesite.com/cgi-bin/foo.cgi?na

Get parameters from URL using CGI

2006-02-18 Thread abcd
i want to create a CGI script which simply prints out values given via the URL (such as when a GET is performed). So if I have a script named, foo.cgi and I access it by going to: http://www.somesite.com/cgi-bin/foo.cgi?name=john&age=90 I want foo.cgi to print out: name: john age: 90 how d