Jump to content

Need help detecting where a user is coming from


$Three3

Recommended Posts

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.

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?

check this code..

<?PHP

FUNCTION getCurrentPage() {
        $thedomain .= "http://";
     $thedomain .= $_SERVER['HTTP_HOST'];
     $thedomain .= $_SERVER['REQUEST_URI'];
     RETURN $thedomain ;
}

ECHO "The current URL is: ".getCurrentPage()."!";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.