$Three3 Posted February 11, 2010 Share Posted February 11, 2010 Hi, I have a slight problem that I have come across when coding for one of my sites. I need to know whether or not a user is coming from a specific address. For example: In order for a user to complete registration for the site, they must come from this url: https://www.somesite.com/cgi/secure?87584 Is there anyway of detecting where a user is coming from? I am almost done with my site but I have been stuck on this for a few days now. Any help is greatly appreciated and thanks in advanced for the help also. Quote Link to comment Share on other sites More sharing options...
tmh766 Posted February 11, 2010 Share Posted February 11, 2010 Hey Is this what you are looking for http://www.php.net/manual/en/reserved.variables.server.php So $_SERVER['HTTP_REFERER']; Quote Link to comment Share on other sites More sharing options...
$Three3 Posted February 11, 2010 Author Share Posted February 11, 2010 Hey Is this what you are looking for http://www.php.net/manual/en/reserved.variables.server.php So $_SERVER['HTTP_REFERER']; Hey thanks for the reply. Yes, that will sort of work, but it does not always work. Is there a better solution other than the HTTP_REFERER? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted February 11, 2010 Share Posted February 11, 2010 check this code.. <?PHP FUNCTION getCurrentPage() { $thedomain .= "http://"; $thedomain .= $_SERVER['HTTP_HOST']; $thedomain .= $_SERVER['REQUEST_URI']; RETURN $thedomain ; } ECHO "The current URL is: ".getCurrentPage()."!"; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.