April 25, 2015

Simple way to get IP Address of visitors of your website using PHP


There are so many reasons why you want to get IP addresses of visitors of your website. some of the major reasons include.
  • You may want to get the location of the user using IP address.
  • You may want to get for Security purposes.
  • You may want to get for unique visitor counts.
  • You may want IP Address just for time pass.
What ever the reason may be you can get IP Address and use that very easily using PHP. 

<?php

$ip = $_SERVER['REMOTE_ADDR'];

?>

That's it now you can get the IP address in ip variable, you can use that variable in any possible way you want to. 

If you have any notes regarding this you can always share that in the comments or you can mail me @ ething4pc@gmail.com

No comments: