$_SERVER php where link came from

PHP
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Source

Also in PHP: