Get Current URL

No replies
admin
admin's picture
User offline. Last seen 2 weeks 2 days ago. Offline
Joined: 03/24/2009

Sometimes we need to get the current URL location to build something inside our application, in fact, is very easy, just we have to use some Server and execution environment information variables in PHP:

$current_url = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];