Results 1 to 4 of 4

Thread: CGI: Getting the Requested URL?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    2

    Question CGI: Getting the Requested URL?

    How do I get the URL that my script is being acessed from by the user?

    Example: A script can be accessed by going to http://hosta.domain/script/, or http://hosta.domain/script/index.cgi, or http://hostb.domain/mirror/script/index.cgi. How can I tell which URL the user typed into their browser from within the script itself?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There should be a REQUEST_URI environment variable, or something very much like it. It contains the URI that the browser requested from the server.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    2
    Thank YOU captain obvious. Of course there should be one.

    I'm asking what that variable is.
    Last edited by Nick2588; Dec 20th, 2003 at 10:41 PM.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Truth be told, from your post I couldn't even deduce that you know what an environment variable is in the first place. So knowing that there IS an environment variable should help you with your search.

    Now go ahead and try not to piss off those that might help you.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width