Nibinaear
March 18th, 2008, 12:24 PM
I know this has been asked before but I can't find the post with it in. How do you get the entire path name including the get parameters (in PHP)? For example:
http://www.mysite.co.uk/hello.php?id=1&type=2
PeejAvery
March 18th, 2008, 02:07 PM
I use SERVER_ADDR for the IP, you can also use SERVER_NAME.
$fullURL = $_SERVER['SERVER_ADDR'] . $_SERVER['REQUEST_URI'];
PeejAvery
March 20th, 2008, 01:44 PM
Oh, I forgot the protocol.
$url = ($_SERVER['SERVER_PORT'] !== '80') ? 'https' : 'http';
$url .= '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];