<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1044349" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1044349</link>
    <description></description>
    <language>en</language>
          <item>
    <title>kazimmerman&#039;s method is best</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/capturing-ip-address-blocking-ip-address#comment-1243300</link>
    <description> &lt;p&gt;kazimmerman&#039;s method is best if just blocking a few IP&#039;s.  If you want that list to dynamically update, you may want to store them in an external text file or database.&lt;/p&gt;
&lt;p&gt;If you want to block a range of IP&#039;s, then you may want to use the &lt;a href=&quot;http://us2.php.net/manual/en/function.ip2long.php&quot;&gt;ip2long()&lt;/a&gt; function.&lt;/p&gt;
 </description>
     <pubDate>Wed, 08 Jul 2009 00:53:40 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1243300 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>INET_ATON() and INET_NTOA()</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/capturing-ip-address-blocking-ip-address#comment-1243296</link>
    <description> &lt;p&gt;INET_ATON() and INET_NTOA() are functions that convert IPs to their integer representation. &lt;/p&gt;
&lt;p&gt;I wouldn&#039;t use them, unless you&#039;re storing thousands of IPs. &lt;/p&gt;
&lt;p&gt;I would use kazimmerman&#039;s method for blocking IPs. There&#039;s no reason to complicate things with those INET functions.&lt;/p&gt;
 </description>
     <pubDate>Tue, 07 Jul 2009 20:43:00 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1243296 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Maybe I&#039;m just ignorant, but</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/capturing-ip-address-blocking-ip-address#comment-1243288</link>
    <description> &lt;p&gt;Maybe I&#039;m just ignorant, but I&#039;ve never used these functions and I&#039;ve been able to block IP addresses before.&lt;/p&gt;
&lt;p&gt;Just set up an array (these can be extracted from a MySQL database if there will be a lot, and to prevent having to edit the PHP file itself) with all of the IP addresses that need to be banned, and then just redirect from that page if the user&#039;s IP address is in the array.  Something like this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$banned &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;x.x.x.x&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;y.y.y.y&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;z.z.z.z&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;in_array&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;REMOTE_ADDR&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;],&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$banned&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Location: differentPage.php&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Normal page here&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 07 Jul 2009 15:50:06 +0000</pubDate>
 <dc:creator>kazimmerman</dc:creator>
 <guid isPermaLink="false">comment 1243288 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
