SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using PHP to retrieve absolute URL

    This is probably easy, but I can't seem to find the answer at PHP.net. I need to have PHP determine the *absolute* URL of the current page, such as...

    http://www.domain.com/directory/page.php?variable=value

    So $PHP_SELF won't work for this purpose. AND... it needs to reflect the URL of the *parent* document if the command (whatever it is) originates from an included file. (It should not list the URL of the included file).

    Can anyone help? Thanks!

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this should work for you

    PHP Code:
    $pagesrc $HTTP_HOST.$REQUEST_URI
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That did the trick! All I had to add was the "http://" at the beginning. Thanks!


Bookmarks

Posting Permissions

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