Skip to content

Instantly share code, notes, and snippets.

@cam-gists
Created August 20, 2012 16:02
Show Gist options
  • Save cam-gists/3405378 to your computer and use it in GitHub Desktop.
Save cam-gists/3405378 to your computer and use it in GitHub Desktop.
PHP: Block IPs
$ip_address = $_SERVER['REMOTE_ADDR'];
$blocked = array('72.214.3.245_off', '208.113.135.66', '67.130.131.194', '70.179.6.61');
if (in_array($ip_address, $blocked)){
echo "blocked";
}else{
echo "not blocked";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment