CoderZone.org

Category: >> PHP Code >> Block Selected IP Addresses Bookmark and Share

<< lastnext >>

Snippet Name: Block Selected IP Addresses

Description: This code creates an list of IP addresses for blocking, then checks the incoming address against the list. If an IP is matched it will redirect the user to a URL you specify.

Also see:
» PayPal Instant Payment Notificatio...
» Strip Comments From Code
» Javascript Include - allows dynami...
» Fastest javascript Trim() function
» Automatically find location of jav...
» mySQL Dtatabase Quota Limit Script
» Add and Remove classes in Javascri...
» Javascript Trim Functions
» Easy date manipulation
» Get Easter Date for any year in Ja...
» Parsing PHP in Javascript Files
» Multi-line variables and strings i...
» Check for a Valid Email Address (V...
» Reserved Words In Javascript
» Fix missing $_SERVER SCRIPT_URL va...
» A JavaScript implementation of the...
» Measure script run time
» Get Query String with Javascript
» Flip Text Upside Down
» Javascript "Fade In On Click&...
» Javascript Confirm Delete Prompt
» Get and set radio buttons with Jav...
» Get and set select lists with Java...
» Use htpasswd file with PHPscripts
» TABLE - Multiple Columns
» INDEXES: Block Dump
» Run script with no output
» UPDATE: based on multiple returned...
» UPDATE: Update multiple rows
» INSERT: Multiple Column Table Or V...

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PERL
Last Modified: March 16th, 2009

<?php
 
$denyIP = array("IP Address 1", "IP Address 2", "IP Address 3");
 
if (in_array ($_SERVER['REMOTE_ADDR'], $denyIP)) {
    header("location: http://www.microsoft.com/");
    exit();
} 
 
?>
 
Add a comment 
MikeDec 9th, 2010 10:11pm
I'll put this to good use. :) Thanks!
© coderzone.org | users online: 10