Page 2 of 2
Posted: Thu Jun 29, 2006 3:47 pm
by Luke
Cool it guys... this is a place for php discussion. The mods won't put up with comments like "I would spit in your face" Keep it clean. There's no need to be rude to eachother. That should be the end of that.
Posted: Thu Jun 29, 2006 3:54 pm
by timvw
Here is a bit of my ip-banning-script (using mysql)... It simply bans ips... Should take the time to implements range-banning etc someday...
Code: Select all
CREATE TABLE mytable (
spammer_ip INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (spammer_ip)
);
Code: Select all
$result = mysql_query("SELECT COUNT(*) AS count FROM mytable WHERE spammer_ip=INET_ATON({$_SERVER['REMOTE_ADDR']}");
$row = mysql_fetch_assoc($result);
if ($row['count'] > 0) {
header('Location: http://' . $_SERVER['REMOTE_ADDR']);
exit;
}
Adding ips is done with a simple INSERT IGNORE....
Posted: Thu Jun 29, 2006 5:51 pm
by Chris Corbyn
OK guys - one more bickering comment from either of you and the topic will be locked and further action may be taken. Seriously... it's just not acceptable to speak to each other like that full-stop; in the street, in a bar, in a web forum, anywhere. It's quite simple really... if you don't want to help then don't reply. Insulting people is
very bad idea here and those who've been around for long enough will be more than aware of it.
Bigun: You're number one resource to check before posting questions =
http://php.net/ If it were legal I'd marry it!
Posted: Thu Jun 29, 2006 9:12 pm
by Bigun
d11wtq wrote:OK guys - one more bickering comment from either of you and the topic will be locked and further action may be taken. Seriously... it's just not acceptable to speak to each other like that full-stop; in the street, in a bar, in a web forum, anywhere. It's quite simple really... if you don't want to help then don't reply. Insulting people is
very bad idea here and those who've been around for long enough will be more than aware of it.
Bigun: You're number one resource to check before posting questions =
http://php.net/ If it were legal I'd marry it!
1) I make every attempt to cool off the RTFM zealots without starting a fire, they sometimes get antsy when people don't comprehend when they read something that is a new language.... literally. I hope I made a decent attempt at such. Not everyone learns by reading, some of us learn by doing, maybe one day they will all understand.
2) I'm aware of php.net, it's great for looking up functions I may use every 6 months or so, it's not a good start for beginners though.
3) This is one of the more friendly forums I've been in. I'd guess it is simply because of how quickly your responses are on flame wars. For an example of what I deal with in my most active forum - head to forums.gentoo.org and do a search for cokehabit under "Off the Wall" forums. If there is a flame war.... he's there. So, I do appreciate what you guys do. But please, to everyone else, everyone has the right to
comprehend information, not just read it. And to those who answer my questions, thanks.
Posted: Thu Jun 29, 2006 9:16 pm
by Bigun
timvw wrote:Here is a bit of my ip-banning-script (using mysql)... It simply bans ips... Should take the time to implements range-banning etc someday...
Code: Select all
CREATE TABLE mytable (
spammer_ip INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (spammer_ip)
);
Code: Select all
$result = mysql_query("SELECT COUNT(*) AS count FROM mytable WHERE spammer_ip=INET_ATON({$_SERVER['REMOTE_ADDR']}");
$row = mysql_fetch_assoc($result);
if ($row['count'] > 0) {
header('Location: http://' . $_SERVER['REMOTE_ADDR']);
exit;
}
Adding ips is done with a simple INSERT IGNORE....
O.o
I have a long ways to go...
I was just going to make every php page check the user's IP with a table of IP's logged, and if they match, the scripts stop cold.