![]() |
Current page's exact URL?
How can I get the full and exact URL of the current page? i.e., protocol://server:port/path/filename?argument1=value1&argument2=value2...
I know how to construct it but I thought that there might be a superglobal that already contains this. |
in a phpinfo file?
- miSt |
...?
Using PHP, if I used phpinfo I'd already know the page's URL :p |
first get root dir with $_SERVER['DOCUMENT_ROOT'] or $DOCUMENT_ROOT, then you can convert it yourself to exact URL. pathinfo() function will help you while you are doing so..
|
$_SERVER['HTTP_HOST']
$_SERVER['SERVER_PORT'] $_SERVER['REQUEST_URI'] not sure about the protocol an if statement? if ($_SERVER['SERVER_PORT'] == 443) { $p = 'https://'; } else { $p = 'http://'; } |
All times are GMT. The time now is 02:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|