If the user has come to your site or a page on your site by following a link elsewhere, then that page should be made available through this variable:
$_SERVER["HTTP_REFERER"]
If there was a link on http://www.xyz.com to http://tech.queryhome.com/index.php and on that page you had:
$detect = $_SERVER["HTTP_REFERER"];
echo "I know where you came from! You clicked on a link from $detect !";
And then you will be able to tell your user where he/she has come from.