Results 1 to 4 of 4

Thread: Current Page

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Current Page

    Hi,

    Is there a way to find out (using php) what page a visitor is currently on?

    e.g. the visitor is on http://www.thisurl.com/this_page.html, i want to use this info within the site as $currenturl

    Did i explain that well?!?
    Cheers.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The global variables $PHP_SELF and $_SERVER['REQUEST_URI'] and the constant __FILE__ should help you.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks Twey, but that only shows the file names or root..

    I want to be able to see the exact url.

    is that possable?

    Cheers.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You can work out the URL. It's
    Code:
    'http://' . $_SERVER['HOST'] . '/' . $_SERVER['REQUEST_URI']
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •