<?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: Block IP address with PHP</title>
	<atom:link href="http://httpguru.com/php-mysql/block-ip-address-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://httpguru.com/php-mysql/block-ip-address-with-php/</link>
	<description>A world for usability</description>
	<lastBuildDate>Fri, 26 Feb 2010 20:23:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Merlin59</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-4930</link>
		<dc:creator>Merlin59</dc:creator>
		<pubDate>Fri, 23 Oct 2009 02:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-4930</guid>
		<description>Wolf gives excellent advice and I know that you will all love reading what he has to say to you! ,</description>
		<content:encoded><![CDATA[<p>Wolf gives excellent advice and I know that you will all love reading what he has to say to you! ,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinothbabu</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-43</link>
		<dc:creator>Vinothbabu</dc:creator>
		<pubDate>Thu, 29 Jan 2009 11:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-43</guid>
		<description>Why dont you use .htaccess to block a domain. Its much better practice.</description>
		<content:encoded><![CDATA[<p>Why dont you use .htaccess to block a domain. Its much better practice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mateo</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-39</link>
		<dc:creator>mateo</dc:creator>
		<pubDate>Mon, 26 Jan 2009 19:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-39</guid>
		<description>What about blocking certain domains instead of IP or IP ranges? This would be very helpful to me. I appreciate any help.

Thanks
Mateo</description>
		<content:encoded><![CDATA[<p>What about blocking certain domains instead of IP or IP ranges? This would be very helpful to me. I appreciate any help.</p>
<p>Thanks<br />
Mateo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinothbabu</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-20</link>
		<dc:creator>Vinothbabu</dc:creator>
		<pubDate>Tue, 13 Jan 2009 11:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-20</guid>
		<description>&lt;strong&gt;Hi, porl.... so you can possibly look into this code below... &lt;/strong&gt;

&lt;blockquote&gt;&lt;strong&gt;&lt;?php
function ipCheck($match_ip, $ip_array) {
We have to make sure that its an array, before we go with foreach.
  if (is_array($ip_array)) {
    // loop through ip array
    foreach ($ip_array as $ip_add) {
  // we are testing if there is a match
      if (strpos($match_ip, $ip_add)===0) {
        return true;
      }
    }
  }
  return false;
}
$ban_array = array(
  &#039;216.47.55.141&#039;,
  &#039;72.47.147&#039;,
  &#039;74.171&#039;,
  &#039;58&#039;
);
if (ipCheck($_SERVER[&#039;REMOTE_ADDR&#039;], $ban_array)) {
  echo &quot;Your message here.&quot;;
  exit;
}
?&gt;&lt;/strong&gt;&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p><strong>Hi, porl&#8230;. so you can possibly look into this code below&#8230; </strong></p>
<blockquote><p><strong>< ?php<br />
function ipCheck($match_ip, $ip_array) {<br />
We have to make sure that its an array, before we go with foreach.<br />
  if (is_array($ip_array)) {<br />
    // loop through ip array<br />
    foreach ($ip_array as $ip_add) {<br />
  // we are testing if there is a match<br />
      if (strpos($match_ip, $ip_add)===0) {<br />
        return true;<br />
      }<br />
    }<br />
  }<br />
  return false;<br />
}<br />
$ban_array = array(<br />
  '216.47.55.141',<br />
  '72.47.147',<br />
  '74.171',<br />
  '58'<br />
);<br />
if (ipCheck($_SERVER['REMOTE_ADDR'], $ban_array)) {<br />
  echo "Your message here.";<br />
  exit;<br />
}<br />
?></strong></p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: porl</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-17</link>
		<dc:creator>porl</dc:creator>
		<pubDate>Fri, 09 Jan 2009 06:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-17</guid>
		<description>IP&#039;s for countries are given in a group of ranges, that would therefore be something like:

215.222.777.0 to 215.222.999.0

and anything in that range is banned (inclusive of start and end figure.
the ability to do this large scale for social sites etc to block out africa etc...
and also singly as well. could be a text file or a mysql database.</description>
		<content:encoded><![CDATA[<p>IP&#8217;s for countries are given in a group of ranges, that would therefore be something like:</p>
<p>215.222.777.0 to 215.222.999.0</p>
<p>and anything in that range is banned (inclusive of start and end figure.<br />
the ability to do this large scale for social sites etc to block out africa etc&#8230;<br />
and also singly as well. could be a text file or a mysql database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinothbabu</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-14</link>
		<dc:creator>Vinothbabu</dc:creator>
		<pubDate>Thu, 08 Jan 2009 10:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-14</guid>
		<description>Porl... 

       What type of range would you like to block... now it may come in handy at rare occation.</description>
		<content:encoded><![CDATA[<p>Porl&#8230; </p>
<p>       What type of range would you like to block&#8230; now it may come in handy at rare occation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Porl</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-12</link>
		<dc:creator>Porl</dc:creator>
		<pubDate>Wed, 07 Jan 2009 00:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-12</guid>
		<description>would be very handy if it offered a range of from and to (inclusive).
Can this be done and how?

Many thanks

Porl</description>
		<content:encoded><![CDATA[<p>would be very handy if it offered a range of from and to (inclusive).<br />
Can this be done and how?</p>
<p>Many thanks</p>
<p>Porl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Honour Chick</title>
		<link>http://httpguru.com/php-mysql/block-ip-address-with-php/comment-page-1/#comment-5</link>
		<dc:creator>Honour Chick</dc:creator>
		<pubDate>Sun, 28 Dec 2008 01:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://httpguru.com/?p=53#comment-5</guid>
		<description>very useful info :) thanks</description>
		<content:encoded><![CDATA[<p>very useful info <img src='http://httpguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
