Hello Reader's if you want to make the tracking system of your website, then the best way is to get the records of the IP address from user. Getting the IP of remote of PC can done on various ways. PHP let you do this by using $_SERVER['REMOTE_ADDR'];
Using code above you will get the IP,
But sometimes this will return the exact IP of remote PC because of various proxy server might in use.
But still you can have the records of individual users accessing your website. But in the cases where the IP is conflicting then you can use the code as below:-
$ip = _SERVER['REMOTE_ADDR']?:$_SERVER['HTTP_X_FORWARDED_;FOR']?:$_ERVER['HTTP_CLIENT_IP']);
The code above is used to get correct this is issue you can use just the code below, that will return IP in $get_ip variable.
0 Comment(s)