Solarum - Information For Everyone

Oct
16

Getting the IP of the current visitor in PHP

Sometimes, you have the need to grab the IP address of the current visitor to your site.  I use this for logging actions like comment forms, etc., but also for blocking IPs if there is a need.  Whatever your reason, this is a good chunk of code, in the form of a function you can call, to return the IP address of whoever is loading that page.  Check it out in the forums!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Slashdot
  • Fark

Add A Comment


MYfilesanywhere
-->

Pages

Articles