note 21551 added to function.gethostbyaddr
| From: | nothanks at nospam dot com | Date: | Thu, 16 May 2002 19:30:01 +0000 |
| Subject: | note 21551 added to function.gethostbyaddr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30728@lists.php.net to get a copy of this message | ||
This is also very useful if you'd like to ban these annoying people that keep spamming your
forums. It requires a clever use of mySql but can be great:
First, make a table for the bans, then make the query:
"SELECT banReason from tBans where '". gethostbyaddr($REMOTE_ADDR) ."' LIKE
banMask"
If your results aren't null it means his host matched a banMask in your DB, so you can redirect
him with header() to a banned.php page and prevent him from accessing any content on your page!
--
http://www.php.net/manual/en/function.gethostbyaddr.php
http://master.php.net/manage/user-notes.php?action=edit+21551
http://master.php.net/manage/user-notes.php?action=delete+21551
http://master.php.net/manage/user-notes.php?action=reject+21551