Skip to content

Instantly share code, notes, and snippets.

@aardvark857
aardvark857 / FCC troll
Created May 11, 2014 09:55
Redirect FCC traffic to horrible sites.
//Not tested. I'll write a better one tomorrow.
<?php
//Sloppily get IP address
$ip = ip2long($_SERVER['REMOTE_ADDR']);
//Sloppily check against FCC addresses
if (( $ip >= ip2long("192.133.125.0") && $ip <= ip2long("192.133.125.24") ) ||
( $ip >= ip2long("165.135.0.0") && $ip <= ip2long("165.135.0.16") ) ||
( $ip >= ip2long("192.104.54.0") && $ip <= ip2long("192.104.54.24") ) ||
( $ip >= ip2long("4.21.126.0") && $ip <= ip2long("4.21.126.0/24") ) ||
( $ip >= ip2long("65.125.25.26") && $ip <= ip2long("65.125.25.64") ) ||