Re: How do I ban an ip address please!
| From: | Robin Vickery | Date: | Fri, 24 Nov 2000 10:08:34 +0000 |
| Subject: | Re: How do I ban an ip address please! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26926@lists.php.net to get a copy of this message | ||
>>>>> "JG" == "Josh G" <josh@gfunk007.com> writes:
> $banned[]="127.0.0.1"; /*Don't actually use this one, eh? :-)*/
> $banned[]="203.32.116.1";
> $banned[]="198.62.61.90";
>
> for ($i=0;$i<sizeof($banned);$i++) {
>
> if ($REMOTE_ADDR==$banned[$i]) {
>
> echo "Piss off jack!"; exit;
>
> }
>
> }
$banned[]="127.0.0.1"; /*Don't actually use this one, eh? :-)*/
$banned[]="203.32.116.1";
$banned[]="198.62.61.90";
if( in_array($REMOTE_ADDR, $banned) ) die( "Interdit!" );
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)870 729 5444