Get Visitor IP Address

by Shabbir on July 28, 2008

in PHP

This tutorial will be explained in PHP. In some of the next tutorials we will explain how to do this in ASP.Net.

So, this is so easy to do, watch this

<?php
   $ip=$_SERVER['REMOTE_ADDR'];
   echo $ip;
?>

Put this code in some HTML page.

When the user opens that page, the command echo will write its IP address to the page.
That's it.

Sharing is Caring...

Other Related Posts:

  1. Read From File In C++
  2. Write To File In C++
  3. Read From File Using StreamReader Class
  4. Converting Between Timezones With PHP
  5. How to Address Double Email Confirmation of AWeber & vBulletin

{ 4 comments… read them below or add one }

Paul July 31, 2008 at 4:49 pm

You haven’t really thought this through have you?

What about someone coming through a proxy?

Reply

Albert July 8, 2009 at 6:21 pm

Wordpress comes with a navigation as to who comments so it is easier to detect spammers.

Reply

Guru September 8, 2009 at 12:31 am

Yes wordpress comes with navigation.

Reply

Albert September 27, 2009 at 4:37 am

Wordpress comes with a navigation as to who comments so it is easier to detect spammers.

Reply

Leave a Comment

Spam protection by WP Captcha-Free

Previous post:

Next post:

    About the Author

  • author photo

    My Name is Shabbir Bhimani and I am developer by profession in the field of applications, web and database. Currently doing full time online marketing and like to share my experiences on how you can make money online @ CodeItWell.com. Read more ...


    See how you can get in touch with me.