Determining from which web page a cgi script is invoked?

Discussion in 'Python' started by davidgould@davidgould.com, Mar 10, 2009.

  1. Guest

    Given a webpage test.html that has a form with a cgi script, how can
    you determine inside the cgi script the name of the webpage that
    invoked the script?

    I have many different html pages that use a common cgi script for form
    processing and want to determine the name of the webpage.

    Thanks.
     
    , Mar 10, 2009
    #1
    1. Advertising

  2. cm Guest

    escribió:
    > Given a webpage test.html that has a form with a cgi script, how can
    > you determine inside the cgi script the name of the webpage that
    > invoked the script?
    >
    > I have many different html pages that use a common cgi script for form
    > processing and want to determine the name of the webpage.


    quick&dirty: Add a hidden form var with the page/form name

    Regards,

    Carlos.
     
    cm, Mar 10, 2009
    #2
    1. Advertising

  3. Tim Chase Guest

    wrote:
    > Given a webpage test.html that has a form with a cgi script, how can
    > you determine inside the cgi script the name of the webpage that
    > invoked the script?
    >
    > I have many different html pages that use a common cgi script for form
    > processing and want to determine the name of the webpage.


    Not that this has anything to do with python...but you're
    interested in the standard "referrer"/"referer" field[1] in your
    request headers. Note that this field IS OPTIONAL. Firefox
    makes it easy to keep the referrer private, so it's never sent.

    -tkc

    [1]
    http://en.wikipedia.org/wiki/Referer
     
    Tim Chase, Mar 10, 2009
    #3
  4. Guest

    On Mar 10, 7:15 pm, cm <> wrote:
    > escribió:
    >
    > > Given a webpage test.html that has a form with a cgi script, how can
    > > you determine inside the cgi script the name of the webpage that
    > > invoked the script?

    >
    > > I have many different html pages that use a common cgi script for form
    > > processing and want to determine the name of the webpage.

    >
    > quick&dirty: Add a hidden form var with the page/form name


    Yes, I had considered this. Is there any way to quickly automate the
    setting of this var to match the html page that contains it?
     
    , Mar 11, 2009
    #4
  5. Guest

    On Mar 10, 7:15 pm, cm <> wrote:
    > escribió:
    >
    > > Given a webpage test.html that has a form with a cgi script, how can
    > > you determine inside the cgi script the name of the webpage that
    > > invoked the script?

    >
    > > I have many different html pages that use a common cgi script for form
    > > processing and want to determine the name of the webpage.

    >
    > quick&dirty: Add a hidden form var with the page/form name


    Yes, I had considered this. Is there any way to quickly automate the
    setting of this var to match the html page that contains it?
     
    , Mar 11, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonas
    Replies:
    4
    Views:
    973
  2. volcano
    Replies:
    4
    Views:
    1,818
    volcano
    Sep 24, 2009
  3. Replies:
    1
    Views:
    370
    Alessandro Zifiglio
    Apr 25, 2006
  4. Replies:
    1
    Views:
    111
  5. kath
    Replies:
    4
    Views:
    739
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page