<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Code The World — Displaye your real ip]]></title>
		<link>https://codetheworld.com/viewtopic.php?id=46</link>
		<atom:link href="https://codetheworld.com/extern.php?action=feed&amp;tid=46&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Displaye your real ip.]]></description>
		<lastBuildDate>Sun, 15 Jun 2008 07:37:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Displaye your real ip]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=82#p82</link>
			<description><![CDATA[<p>Cool...</p><p>$_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;] is proxy behind the NAT router. And it could contain multiple IP addresses if the request was forwarded trough multiple proxies. So, maybe convert it to an array, something like this:<br /></p><div class="codebox"><pre><code> $ip = array();
    // check if it&#039;s set, and if it&#039;s more then one
    if  (isset($_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;]) &amp;&amp; strpos($_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;],&#039;,&#039;))  
    {
        $ip +=  explode(&#039;,&#039;,$_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;]);     //add IPs from all proxies to the ip array
    } elseif (isset($_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;])) 
    {
        $ip[] = $_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;];                      // add the one that you got
    }
   $ip[] = $_SERVER[&#039;REMOTE_ADDR&#039;];                                            // the default one</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (3bep)]]></author>
			<pubDate>Sun, 15 Jun 2008 07:37:02 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=82#p82</guid>
		</item>
		<item>
			<title><![CDATA[Displaye your real ip]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=71#p71</link>
			<description><![CDATA[<p>&lt;?php<br />$ip = isset($_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;]) ? $_SERVER[&#039;HTTP_X_FORWARDED_FOR&#039;] : $_SERVER[&#039;REMOTE_ADDR&#039;];<br />echo &#039;Your IP is: &#039;.$ip; ?&gt;</p><p>What do youse think?</p>]]></description>
			<author><![CDATA[null@example.com (Hornet)]]></author>
			<pubDate>Sun, 15 Jun 2008 07:07:08 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=71#p71</guid>
		</item>
	</channel>
</rss>
