<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Getting real IP address in PHP</title>
	<atom:link href="http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/feed" rel="self" type="application/rss+xml" />
	<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html</link>
	<description>Useful Tutorials, Scripts , Tips, and Resources for all PHP and Ajax beginners and experts .</description>
	<lastBuildDate>Sun, 14 Mar 2010 01:15:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: El Blog de JF &#187; Obtener Dirección ip en PHP</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-5051</link>
		<dc:creator>El Blog de JF &#187; Obtener Dirección ip en PHP</dc:creator>
		<pubDate>Sat, 16 Jan 2010 20:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-5051</guid>
		<description>[...] Fuente &#124; http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html [...]</description>
		<content:encoded><![CDATA[<p>[...] Fuente | <a href="http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html" rel="nofollow">http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4800</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Tue, 10 Nov 2009 03:49:32 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4800</guid>
		<description>Ben:  You&#039;re an idiot, this script gets the physical location IP address for geostatistics.  The person&#039;s private IP (192.168.0.x) means absolutely nothing to a web page owner.</description>
		<content:encoded><![CDATA[<p>Ben:  You&#8217;re an idiot, this script gets the physical location IP address for geostatistics.  The person&#8217;s private IP (192.168.0.x) means absolutely nothing to a web page owner.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4799</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Tue, 10 Nov 2009 01:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4799</guid>
		<description>I did the following, however, please note that I required the VPN detection and simply return VPN for local ips.

function getRealIP($fakeip=false) {
    	
		$ip = (!empty($_SERVER[&#039;HTTP_CLIENT_IP&#039;])) ? (!empty($_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;])) ? $_SERVER[&#039;HTTP_CLIENT_IP&#039;] : preg_replace(&#039;/(?:,.*)/&#039;, &#039;&#039;, $_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;]):$_SERVER[&#039;REMOTE_ADDR&#039;];
		$ip = (!$fakeip) ? $ip:$fakeip;
		
		// local check class b and c
		$patterns = array(&quot;/(192).(168).(\d+).(\d+)/i&quot;,&quot;/(10).(\d+).(\d+).(\d+)/i&quot;);
		foreach($patterns as $pattern) {
			if(preg_match($pattern,$ip)) {
				return &quot;VPN&quot;;
			}
		}
		// local check class a
		$parts = explode(&quot;.&quot;,$ip);
		if($parts[0]==172 &amp;&amp; ($parts[1]&gt;15 &#124;&#124; $parts[1]&lt;32)) {
			return &quot;VPN&quot;;
		}
		return trim($ip);
    }</description>
		<content:encoded><![CDATA[<p>I did the following, however, please note that I required the VPN detection and simply return VPN for local ips.</p>
<p>function getRealIP($fakeip=false) {</p>
<p>		$ip = (!empty($_SERVER['HTTP_CLIENT_IP'])) ? (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_CLIENT_IP'] : preg_replace(&#8216;/(?:,.*)/&#8217;, &#8221;, $_SERVER['HTTP_X_FORWARDED_FOR']):$_SERVER['REMOTE_ADDR'];<br />
		$ip = (!$fakeip) ? $ip:$fakeip;</p>
<p>		// local check class b and c<br />
		$patterns = array(&#8220;/(192).(168).(\d+).(\d+)/i&#8221;,&#8221;/(10).(\d+).(\d+).(\d+)/i&#8221;);<br />
		foreach($patterns as $pattern) {<br />
			if(preg_match($pattern,$ip)) {<br />
				return &#8220;VPN&#8221;;<br />
			}<br />
		}<br />
		// local check class a<br />
		$parts = explode(&#8220;.&#8221;,$ip);<br />
		if($parts[0]==172 &amp;&amp; ($parts[1]&gt;15 || $parts[1]&lt;32)) {<br />
			return &quot;VPN&quot;;<br />
		}<br />
		return trim($ip);<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Goldendevelopersworld.com &#187; Blog Archive &#187; 10 code snippets for PHP developers</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4790</link>
		<dc:creator>Goldendevelopersworld.com &#187; Blog Archive &#187; 10 code snippets for PHP developers</dc:creator>
		<pubDate>Thu, 05 Nov 2009 17:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4790</guid>
		<description>[...] Get IP address Returns the real IP address of a visitor, even when connecting via a proxy. Source : http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html [...]</description>
		<content:encoded><![CDATA[<p>[...] Get IP address Returns the real IP address of a visitor, even when connecting via a proxy. Source : <a href="http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html" rel="nofollow">http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucabay</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4748</link>
		<dc:creator>bucabay</dc:creator>
		<pubDate>Wed, 28 Oct 2009 08:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4748</guid>
		<description>&quot;is there a way in php of knowing if the email address supplied by the user is existing?&quot;

Yes, take a look at this PHP library - http://code.google.com/p/php-smtp-email-validation/
It validates email addresses through SMTP.</description>
		<content:encoded><![CDATA[<p>&#8220;is there a way in php of knowing if the email address supplied by the user is existing?&#8221;</p>
<p>Yes, take a look at this PHP library &#8211; <a href="http://code.google.com/p/php-smtp-email-validation/" rel="nofollow">http://code.google.com/p/php-smtp-email-validation/</a><br />
It validates email addresses through SMTP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4735</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sat, 24 Oct 2009 14:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4735</guid>
		<description>Brilliant - this will work 98% of the time - and if someone is trying to fake there IP address I don&#039;t care.</description>
		<content:encoded><![CDATA[<p>Brilliant &#8211; this will work 98% of the time &#8211; and if someone is trying to fake there IP address I don&#8217;t care.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ravi</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4649</link>
		<dc:creator>ravi</dc:creator>
		<pubDate>Sat, 03 Oct 2009 16:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4649</guid>
		<description>Hey!…Thanks for the nice read, keep up the interesting posts..what a nice Saturday</description>
		<content:encoded><![CDATA[<p>Hey!…Thanks for the nice read, keep up the interesting posts..what a nice Saturday</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How To Trace the Actual Client&#8217;s IP Address using PHP Script? &#124; Engineering Blog</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4624</link>
		<dc:creator>How To Trace the Actual Client&#8217;s IP Address using PHP Script? &#124; Engineering Blog</dc:creator>
		<pubDate>Fri, 25 Sep 2009 14:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4624</guid>
		<description>[...] source: http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html [...]</description>
		<content:encoded><![CDATA[<p>[...] source: <a href="http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html" rel="nofollow">http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinayak</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4622</link>
		<dc:creator>Vinayak</dc:creator>
		<pubDate>Fri, 25 Sep 2009 09:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4622</guid>
		<description>Thanks Dude! You helped alot! Keep rockingggggg</description>
		<content:encoded><![CDATA[<p>Thanks Dude! You helped alot! Keep rockingggggg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: classifier</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4603</link>
		<dc:creator>classifier</dc:creator>
		<pubDate>Sun, 20 Sep 2009 13:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4603</guid>
		<description>As Andrew wrote on 3 January, 2008,
I’ve written a Perl module that uses NetAddr::IP to determine if an IP address is private or public. I then check each of HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR and REMOTE_ADDR and return the first one that is public. If none of them are public I return REMOTE_ADDR.
Any option to have this code shared ?</description>
		<content:encoded><![CDATA[<p>As Andrew wrote on 3 January, 2008,<br />
I’ve written a Perl module that uses NetAddr::IP to determine if an IP address is private or public. I then check each of HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR and REMOTE_ADDR and return the first one that is public. If none of them are public I return REMOTE_ADDR.<br />
Any option to have this code shared ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gautam</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4577</link>
		<dc:creator>Gautam</dc:creator>
		<pubDate>Mon, 14 Sep 2009 05:12:25 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4577</guid>
		<description>The final code is

</description>
		<content:encoded><![CDATA[<p>The final code is</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4551</link>
		<dc:creator>Vladimir</dc:creator>
		<pubDate>Sat, 05 Sep 2009 13:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4551</guid>
		<description>Thanks for the help with code that I searched and interesting subject discussion.</description>
		<content:encoded><![CDATA[<p>Thanks for the help with code that I searched and interesting subject discussion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua K Roberson</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4307</link>
		<dc:creator>Joshua K Roberson</dc:creator>
		<pubDate>Sun, 02 Aug 2009 05:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4307</guid>
		<description>Here are different ways to store an IP or an IP range as well as query for the IPs.
&lt;a href=&quot;http://strictcoder.blogspot.com/2009/08/different-ways-to-query-for-ip-in-your.html&quot; rel=&quot;nofollow&quot;&gt;http://strictcoder.blogspot.com/2009/08/different-ways-to-query-for-ip-in-your.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Here are different ways to store an IP or an IP range as well as query for the IPs.<br />
<a href="http://strictcoder.blogspot.com/2009/08/different-ways-to-query-for-ip-in-your.html" rel="nofollow">http://strictcoder.blogspot.com/2009/08/different-ways-to-query-for-ip-in-your.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Obtener Dirección IP con PHP &#187; unijimpe</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4305</link>
		<dc:creator>Obtener Dirección IP con PHP &#187; unijimpe</dc:creator>
		<pubDate>Sat, 01 Aug 2009 19:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4305</guid>
		<description>[...] Getting real IP address in PHP [...]</description>
		<content:encoded><![CDATA[<p>[...] Getting real IP address in PHP [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haberler</title>
		<link>http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html/comment-page-2#comment-4258</link>
		<dc:creator>haberler</dc:creator>
		<pubDate>Sun, 26 Jul 2009 11:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/getting-real-ip-address-in-php/#comment-4258</guid>
		<description>i used this function and its working . Thank you.</description>
		<content:encoded><![CDATA[<p>i used this function and its working . Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
