Re: How do I ban an ip address please!
| From: | Josh G | Date: | Fri, 24 Nov 2000 02:33:09 +0000 |
| Subject: | Re: How do I ban an ip address please! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26895@lists.php.net to get a copy of this message | ||
$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;
}
}
-Gfunk
"I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to. . . suffering."
visit me at: http://www.gfunk007.com/
----- Original Message -----
From: "Sandeep Hundal" <sandeep_wde@yahoo.com>
To: <tyler.longren@midiowa.net>
Cc: "PHP-General" <php-general@lists.php.net>
Sent: Friday, November 24, 2000 1:30 PM
Subject: Re: [PHP] How do I ban an ip address please!
> nice!! how can i have a whole bunch of ip addresses added to that
> list? ;)
>
>
> --- Tyler Longren <tyler.longren@midiowa.net> wrote: > <?
> > if ($REMOTE_ADDR == "ip.to.ba.n") {
> > echo "You've been banned!!!";
> > }
> > else {
> > // continue with code
> > }
> > ?>
> >
> > eh?
> >
> > Tyler
> >
> > On Thu, 23 Nov 2000, Sandeep Hundal wrote:
> > > Date: Thu, 23 Nov 2000 18:23:45 -0800 (PST)
> > > To: php-general@lists.php.net
> > > From: Sandeep Hundal <sandeep_wde@yahoo.com>
> > > Subject: [PHP] How do I ban an ip address please!
> > >
> > > Hi all,
> > >
> > > I'm using Bare Bones bulletin board, and making something akin my
> > own
> > > version of a message board for articles. I'm tracking all IP
> > > addresses in a mysql column, but would now also like to add in
> > the
> > > ability to ban ip address.
> > >
> > > Any pointers, pieces of code, help etc??
> > >
> > > thanks!
> > >
> > >
> > > /sunny
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Shopping - Thousands of Stores. Millions of Products.
> > > http://shopping.yahoo.com/
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> > >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>