Webmaster Forum  

Go Back   Webmaster Forum > Marketing, SEO and Development > Programming
User Name
Password
Register FAQ Members List Calendar Transactions Store Search Today's Posts Mark Forums Read


Find Real IP

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-17-2007, 19:24
asapcorp
Member

asapcorp's Avatar

Join Date: Apr 2007
Posts: 31
Trader Rating: (0)
Points: 1 (Donate)
5 F$/Referral Refer Friends
asapcorp is on a distinguished road
Default Find Real IP

Hi all,

Here is the code to find the real IP address if someone has gone through a proxy server:
Code:
function get_real_ip()
{
     $ip = false;
     if(!empty($_SERVER['HTTP_CLIENT_IP']))
     {
          $ip = $_SERVER['HTTP_CLIENT_IP'];
     }
     if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
     {
          $ips = explode(", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
          if($ip)
          {
               array_unshift($ips, $ip);
               $ip = false;
          }
          for($i = 0; $i < count($ips); $i++)
          {
               if(!preg_match("/^(10|172\.16|192\.168)\./i", $ips[$i]))
               {
                    if(version_compare(phpversion(), "5.0.0", ">="))
                    {
                         if(ip2long($ips[$i]) != false)
                         {
                              $ip = $ips[$i];
                              break;
                         }
                    }
                    else
                    {
                         if(ip2long($ips[$i]) != - 1)
                         {
                              $ip = $ips[$i];
                              break;
                         }
                    }
               }
          }
     }
     return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}
asapcorp is offline
Reply With Quote
  #2  
Old 04-19-2007, 15:58
Fewski
Senior Member


Join Date: Oct 2006
Posts: 136
Trader Rating: (0)
Points: 1 (Donate)
5 F$/Referral Refer Friends
Fewski is on a distinguished road
Default Re: Find Real IP

Thats cool, didn't know there was a way to do that. Thanks!
Fewski is offline
Reply With Quote
  #3  
Old 04-22-2007, 13:55
d0nk3y
Junior Member


Join Date: Apr 2007
Location: Wisconsin, USA
Posts: 10
Trader Rating: (0)
Points: 10 (Donate)
5 F$/Referral Refer Friends
d0nk3y is on a distinguished road
Default Re: Find Real IP

Sorry to bump, but thanks, this will help me out, and a friend was recently looking for it Not sure if he got it yet
d0nk3y is offline
Reply With Quote
  #4  
Old 05-15-2007, 08:26
phonexiukas
Member


Join Date: Apr 2007
Posts: 36
Trader Rating: (0)
Points: 9 (Donate)
5 F$/Referral Refer Friends
phonexiukas is on a distinguished road
Default Re: Find Real IP

Ooo thans so much I was looking for it
phonexiukas is offline
Reply With Quote
  #5  
Old 05-15-2007, 10:05
madafakeris2008
Junior Member


Join Date: May 2007
Posts: 15
Trader Rating: (0)
Points: 8 (Donate)
5 F$/Referral Refer Friends
madafakeris2008 is on a distinguished road
Default Re: Find Real IP

I hardly believe that this is working. And I 99% guarantee that it doesn't. Anonymous proxies can be cought only by some kind of filter.
madafakeris2008 is offline
Reply With Quote
  #6  
Old 06-10-2007, 15:09
anions
Senior Member


Join Date: Jun 2007
Posts: 135
Trader Rating: (0)
Points: 0 (Donate)
5 F$/Referral Refer Friends
anions is on a distinguished road
Default Re: Find Real IP

oh man tjanks very much..i didnot believe that it would work,,,but it worked,,thanks very much
__________________
Hacks | Tech Tips
anions is offline
Reply With Quote
  #7  
Old 06-12-2007, 20:05
vilStewart
Junior Member

vilStewart's Avatar

Join Date: Jun 2007
Location: Mississippi, US
Posts: 11
Trader Rating: (0)
Points: 1 (Donate)
5 F$/Referral Refer Friends
vilStewart is on a distinguished road
Send a message via AIM to vilStewart Send a message via MSN to vilStewart
Default Re: Find Real IP

Does it really work with proxies that are actually a little more protected ? ;D
__________________
stewart:howe
Web Developer & Programmer
Vilario.com | Celermedia.com
vilStewart is offline
Reply With Quote
  #8  
Old 06-19-2007, 13:02
karthikeyan
Senior Member


Join Date: Jun 2007
Posts: 260
Trader Rating: (0)
Points: 14 (Donate)
5 F$/Referral Refer Friends
karthikeyan is on a distinguished road
Default Re: Find Real IP

Oh thanks let me check it and post the comment
__________________
Chat2Friends ||Free Hosting Services
karthikeyan is offline
Reply With Quote
  #9  
Old 06-28-2007, 18:03
PHPManiac
Junior Member


Join Date: Jun 2007
Posts: 20
Trader Rating: (0)
Points: 1 (Donate)
5 F$/Referral Refer Friends
PHPManiac is on a distinguished road
Default Re: Find Real IP

Nice simple code mate. This could help lots of sites that ban people but they come back with proxies etc.
Cheers.
PHPManiac is offline
Reply With Quote
  #10  
Old 07-06-2007, 01:31
amjohns5
Junior Member


Join Date: Jul 2007
Posts: 10
Trader Rating: (0)
Points: 6 (Donate)
5 F$/Referral Refer Friends
amjohns5 is on a distinguished road
Default Re: Find Real IP

Very cool! Very useful, also. Cheers, mate.
amjohns5 is offline
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Know how DNS Work. blackwizard Domain Name Forum 0 10-02-2006 09:29
How can you find a targeted user`s ip in cpanel hell-knight Web Hosting Tutorials 1 06-12-2006 16:01
Whois-it.com | Free whois, IP lookup, ping tools and more! redz Other Free Resources 0 01-13-2006 20:16
IP Deny Manager asp Web Hosting Forum 0 06-04-2005 22:07
How do I block an IP address using Cpanel? asp Web Hosting Forum 0 06-04-2005 20:44

Resources : | Advertise at FHF | itextLink.com| Reseller Hosting| TextDot| iNamePros| Any Webmaster| Web Host| Dep3|


All times are GMT -4. The time now is 07:03.


Powered by: vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.