Firewall Protection: Restrict the access to pages based on IP address

Recommend this page to a friend!
  Info   View files (4)   Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 720 All time: 4,547 This week: 364
Version License PHP version Categories
firewall-protection 0.7GNU Lesser Genera...5.0HTTP, PHP 5, Security
Description Author

This class can be used to restrict the access to pages based on IP address.

It can check if the IP address of the user computer and compares it to ranges of allowed and forbidden IP addresses.

If the IP address is not in the list of allowed addresses or is in the list in forbidden address, the class throws an exception.

The lists of allowed and forbidden addresses may be defined programmatically or read from a configuration file in XML format.

The class also gives you oppertunity for XXS filtering and SQL injection escaping at a global level so you can be 100% safe and you do not need to escape any data in your script.

Now you also can block all input, this is most not nessecary, but it can be used for emergency and when site is down or if you are just showing static page.

Picture of Petter Kjelkenes
Name: Petter Kjelkenes <contact>
Classes: 9 packages by
Country: Norway Norway
Age: 30
All time rank: 5562 in Norway Norway
Week rank: 246 1 in Norway Norway
Innovation award
Innovation award
Nominee: 2x

File Role Description
firewall.class.php Class The firewall class source
example.configscript.php Example Config loaded firewall example!
example.firewall.php Example Example usage
firewallconfig.xml Data Config script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,547
This week:364
User Comments (1)
Flawed by design.
9 years ago (Artur Graniszewski)

For more information send a message to info at phpclasses dot org.