On 09/01/14 22:30, Terry Carroll wrote:
How can my Python 2.7 CGI program find the URL that caused the program
to be called?

You don't say what modules or toolkits you are using but I'll assume for now its the standard library cgi module?

I'm not sure what you are looking for. Is it the url that the user clicked on in their browser? Why would you need that dynamically,
its calling your file. You should know where your file is?
Or is your file being called from many different page links and you want the specific link? Usually that's done by adding a marker to the submitted data on the form?

If you want to create a png file and display it to the user
then you just store the file somewhere in your web site and
create an html file that has an img tag referencing that location.
You shouldn't need the calling url to do that unless you
are working across multiple web sites or somesuch.

Can you explain a bit more about the use case that requires you
to know the incoming url?


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to