current url?

Discussion in 'PHP' started by izlik, Feb 25, 2011.

  1. #1
    Hey

    Can someone help me, i want to print out the current url and wonder how i can do this ? if i have a href=, i want the current url to be after the =. how can i do this ?
     
    izlik, Feb 25, 2011 IP
  2. langtusitinh225

    langtusitinh225 Greenhorn

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    
    $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    
    PHP:
     
    langtusitinh225, Feb 25, 2011 IP