Hello Friends I need your help i have a php site and i need a php code from which i can able to know from where visitors coming to my site and from which IP address etc....there are many plugins available from which we can easily know about the visitors but i want the manual php code from which we can easily know about this.Please provide me the code and also advice me how to use it in my site the procedure to use the code in my site. Waiting for your reply.Its Urgent for me to know this. Thanks.
$referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; PHP: Could use any other default IP, if they aren't providing an IP, they shouldn't be allowed to access your server anywhere (default die() on my servers.) Dan
Like dan said, $_SERVER['HTTP_REFERER'] carries the website where the user come from. If its empty, visitors might be directly entering your website url or blocked by software. $_SERVER['REMOTE_ADDR'] carries the ip address of the visitor.