$_SERVER['HTTP_REFERER'] gives you the URL from where the user came, which is the user’s previous page (whatever page that would appear if the user clicked “Back” in their browser)
$_SERVER['HTTP_REFERER'] gives you the complete URL, something like this :
If you just want get the domain name .i.e. driverstest.info from the full URL, then you can use the following code:
$referer = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
Note though that the referer is easy to spoof, so it’s not reliable.