News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMac.com:
IP Banning
March 06, 2006 @ 07:18:29

PHPMac.com has posted a quick tutorial on how to "ban an IP" from your site.

Blocking certain IP addresses from your site is actually much easier than you might think.

In fact, it is only a seven-line code inserted at the top of your page!

The code basically just looks in an array of IP values and checks to see if the remote user's matches any of them. If it does, it echos out an error and stops the page execution. Obviously, this is just a basic example, and could be enhanced with a databse table that would be easier to manage than just the static array.

0 comments voice your opinion now!
IP banning remote address check array stop execution IP banning remote address check array stop execution


blog comments powered by Disqus

Similar Posts

Kevin Schroeder's Blog: Remote Debugging with the Zend Debugger and PHPUnit

Sebastian Nohn's Blog: Using Net_DNSBL and Nagios to check if your SMTP server is listed in a RBL

APress.com: Quick Caching With PHP Sessions

Derick Rethans' Blog: Overloaded properties (__get)

CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS


Community Events

Don't see your event here?
Let us know!


opinion api symfony2 voicesoftheelephpant example configure performance release php7 language interview series community conference laravel framework library application podcast introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework