How to determine current URL in PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonathan

    How to determine current URL in PHP?

    Is there a way that I can determine the current url/location (like the
    'location' variable in javascript)? For example, if I'm at
    http://mysite.com/index.php, is there perhaps a fixed variable
    containing 'http://mysite.com/index.php' already available, or is
    there a function available to retrieve it? I want to use this to log
    certain hits on my site, so it would be nice to have a way to do it
    all in one page rather than integrating information sent with the help
    of javascript from another page.

    Thanks in advance!

    Jon

  • Gary L. Burnore

    #2
    Re: How to determine current URL in PHP?

    On 6 Jul 2004 17:18:44 -0700, thewebdevelopme nt@yahoo.com (Jonathan)
    wrote:
    [color=blue]
    >Is there a way that I can determine the current url/location (like the
    >'location' variable in javascript)? For example, if I'm at
    >http://mysite.com/index.php, is there perhaps a fixed variable
    >containing 'http://mysite.com/index.php' already available, or is
    >there a function available to retrieve it? I want to use this to log
    >certain hits on my site, so it would be nice to have a way to do it
    >all in one page rather than integrating information sent with the help
    >of javascript from another page.[/color]

    It's one of many variables set automatically. To find them all, put
    this in your script:

    phpinfo();

    Put an exit(); after it if you don't want anything else in your script
    to execute while your checking.





    --
    gburnore@databa six dot com
    ---------------------------------------------------------------------------
    How you look depends on where you go.
    ---------------------------------------------------------------------------
    Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
    Black Helicopter Repair Svcs Division | Official Proof of Purchase
    =============== =============== =============== =============== ===============
    Want one? GET one! http://www.databasix.com
    =============== =============== =============== =============== ===============

    Comment

    Working...