Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 05-30-2005, 01:09 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
How to block IPs

need to block one or more IPs from visiting your pages?
surfing the web, I was able to find this hint:

Code:
$addr = array("1.2.3.4", "1.2.3.5", "1.2.3.6"); // array of IPs..
foreach($addr AS $key=>$value)
if (strstr($_SERVER['REMOTE_ADDR'], $value))
{
Header("Location:www.yahoo.com");
}
you can insert this code just before the line starting with
error_reporting(0)
in the /index.php file.

I used it to block a static IP of a person I didn't want, and it works!
others could find it useful to permanently block spammers, ex-girlfriends, and so on
Reply With Quote
  #2  
Old 05-30-2005, 01:39 PM
Connie
Guest
 
Posts: n/a
I just wanted to add ex-boyfriends but I must admit that nearly 99,9% of my ex-boyfriends are computer-illiterate, even my beloved husband :lol:
Reply With Quote
  #3  
Old 05-30-2005, 09:29 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
well, I did it for that reason, really :twisted:
now, when she visits my blog (if ever) she gets a wonderful
http://steff.altervista.org/403.html

anyway, joking apart, don't you think this can be useful to stop spam?
Reply With Quote
  #4  
Old 05-30-2005, 09:43 PM
Connie
Guest
 
Posts: n/a
yes, it could be an addon

more and more this security topic is coming ahead, anti-comment-spam, anti-referrer-spam, blocking IP-adresses

but I would be careful with blocking IP-adresses, I once used it in another script (like an online-lottery), and even participants who did not enter any answer before were blogged by the IP-list, were told they couldn't enter again..

there was the IP of one of the biggest providers in that IP-list ... how to take care of these adresses? most likely users will come with a dynamic adress ...
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 03:54 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs