View Single Post
Old 02-07-2008, 21:56   #10924
Dephormation
Inactive
 
Join Date: Apr 2008
Location: Bristol
Services: Aquiss.net and loving it. No more Virgin Media, no more Virgin Phone, no more Virgin Mobile.
Posts: 629
Dephormation is a name known to allDephormation is a name known to allDephormation is a name known to allDephormation is a name known to allDephormation is a name known to allDephormation is a name known to allDephormation is a name known to allDephormation is a name known to all
Re: Virgin Media Phorm Webwise Adverts [Updated: See Post No. 1, 77, 102 & 797]

Quote:
Originally Posted by warescouse View Post
Now I think about it I did something similar in PHP for the Parasites team... (Its running on Wintel but has PHP).

Its very easy to do with pattern matching (if you're into regular expressions like me);


// Set banned IP range
// Phorm Comcast; 71.224.0.0-71.225.255.255 (71.225.148.61)
// Phorm HT Systems; 78.110.48.0-78.110.55.255 (78.110.48.130)
$targetAddr = array ("^71\.22[45]\.","^78\.110\.4[89]\.","^78\.110\.5[012345]\.");

foreach($targetAddr as $var)
{
if (ereg($var, $_SERVER['REMOTE_ADDR']))
{
echo "<html><head>";
echo "<meta http-equiv='refresh' content='2;url=http://www.google.com/search?q=fleas'>";
echo "<title>Scratch that itch!</title></head><body>";
echo "<p><img src='/images/flea.png' align='middle'><br/>Sorry, there seems to be a bug in our code.<br/>Thanks for jumping by.</p>";
echo "</body></html>";
exit;
}
}//End banned IP range
Dephormation is offline