html - How to track users origin PHP by using example.com/index.php?ref=origin -


how track users origin in php , see people using ref= don't have idea how request works .

my code

 $calling_url = mysql_real_escape_string($_server['http_referer']); 

url:

http://example.com/index.php?ref=http://externalsite.com/page.html or
http://example.com/index.php?ref=http%3a%2f%2fexternalsite.com%2fpage.html

php:

$ref = mysql_real_escape_string(rawurldecode($_get["ref"])); // $ref "http://externalsite.com/page.html" in both cases 

resources url tracking:


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -