$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. Link to comment https://forums.phpfreaks.com/topic/191722-need-help-detecting-where-a-user-is-coming-from/ 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']; Link to comment https://forums.phpfreaks.com/topic/191722-need-help-detecting-where-a-user-is-coming-from/#findComment-1010532 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? Link to comment https://forums.phpfreaks.com/topic/191722-need-help-detecting-where-a-user-is-coming-from/#findComment-1010533 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()."!"; ?> Link to comment https://forums.phpfreaks.com/topic/191722-need-help-detecting-where-a-user-is-coming-from/#findComment-1010724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.