<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
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/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>cdn - WP2X</title> <atom:link href="https://wp2x.com/tag/cdn/feed/" rel="self" type="application/rss+xml" /><link>https://wp2x.com</link> <description>We can help your Wordpress faster</description> <lastBuildDate>Tue, 16 Sep 2014 14:15:23 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod> hourly </sy:updatePeriod> <sy:updateFrequency> 1 </sy:updateFrequency> <generator>https://wordpress.org/?v=5.6.16</generator> <item><title>How to get CloudFlare Visitor IPs in PHP?</title><link>https://wp2x.com/get-cloudflare-visitor-ips-php/</link> <comments>https://wp2x.com/get-cloudflare-visitor-ips-php/#comments</comments> <dc:creator><![CDATA[david]]></dc:creator> <pubDate>Sun, 29 Jun 2014 21:27:33 +0000</pubDate> <category><![CDATA[Blog]]></category> <category><![CDATA[Wordpress Hosting]]></category> <category><![CDATA[Wordpress Tips]]></category> <category><![CDATA[cdn]]></category> <category><![CDATA[cloudflare]]></category> <category><![CDATA[wordpress optimization]]></category> <guid
isPermaLink="false">http://wp2x.com/?p=220</guid><description><![CDATA[<p>Not much, but in this blog post, you can expect the easiest way How to get CloudFlare Visitor IPs in PHP programming. As a webmaster, we always want to improve the website performance with CDN, so that I decide to go with CloudFlare. But we usually meet the problem CloudFlare with website/forum spam what we can&#8217;t ...</p><p>The post <a
rel="nofollow" href="https://wp2x.com/get-cloudflare-visitor-ips-php/">How to get CloudFlare Visitor IPs in PHP?</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Not much, but in this blog post, you can expect the <strong>easiest</strong> way <strong>How to get CloudFlare Visitor IPs in PHP programming.</strong></p><p>As a webmaster, we always want to improve the website performance with CDN, so that I decide to go with CloudFlare. But we usually meet the problem CloudFlare with website/forum spam what we can&#8217;t check spam via visitors IPs because we are under CloudFlare proxy server.</p><p>Very simple with this PHP code</p><pre class="lang:php decode:true ">if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])){
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}</pre><p>&nbsp;</p><p>If you want to get the real IP value from cloudflare to your PHP source in the way what you don&#8217;t have to change anything in coding but the system still run base on the real visitors IPs, you can use this way:</p><pre class="lang:php decode:true ">if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}</pre><p>&nbsp;</p><p>The post <a
rel="nofollow" href="https://wp2x.com/get-cloudflare-visitor-ips-php/">How to get CloudFlare Visitor IPs in PHP?</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></content:encoded> <wfw:commentRss>https://wp2x.com/get-cloudflare-visitor-ips-php/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> </channel> </rss>