Results 1 to 3 of 3

Thread: Current Page URL

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Current Page URL

    I wish to have a link on an "invisible page", so I can't manually type the link. Does anyone know the php code to insert the current URL of the page it is on?

    So I can do e.g:
    HTML Code:
    <a href="PHP Code thing here">Current Page</a>

    And it will link to the page you are already on, but NOT a refresh link?
    My dear friend Google couldn't help me

  2. #2
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Found it, wow, I must be blind. Ignore this post please ^^

    PHP Code:
    <?php echo $_SERVER["PHP_SELF"?>

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

    Default

    Code:
    <a href="<?php echo $_REQUEST['HTTP_REQUEST_URI']; ?>">Current Page</a>
    should work for 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!

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
  •