|
|
 |
Re: FN-FORUM: Blocking IPs
date posted 1st February 2007 17:43
On Thursday 01 February 2007 17:21, Richard Fletcher wrote:
> On Thursday 01 February 2007 17:01, Michelle Penny wrote:
> > You're right there is a need to be careful Dai. I actually want to block
> > one IP address which I've found is a bot in America. The hosting for the
> > site has said I will need to block IPs through php or asp does anyone
> > know of a good basic script that allows me to do that having not done it
> > this way before!!
>
> Does the hosting support asp or php? It's likely to be one or the other.
>
> It seems odd that they don't support .htaccess if the hosting is linux. I
> don't know about Windows hosting. Did my proposed method not work?
>
> Anyway, the PHP solution is that you would check against the
> $_SERVER['REMOTE_ADDR'] variable and die on the user if it matched your
> list. But you would have to do that for every page, unless you could do a
> rewrite for a particular IP address by using .htaccess (anyone?), which is
> not helpful if there is no support for .htaccess.
>
> Even then the users could acces images directly.
perhaps the bot might respect a robots.txt file ?
Otherwise one approach that has worked for me is just to protect forms
processors by checking $_SERVER['REMOTE_ADDR'] as above prior to processing
the form input .
I perfer to abort the form processing there, returning TRUE as if the data had
processed OK rather than die. Thus the bot gets no feedback that it has
failed.
IanR
---
http://narian.org.uk GSM: 07906-204-878 Landline: 01382 805 079
|
 |
|