Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-05-2012, 08:48 PM   PM User | #1
Mayhem30
New Coder

 
Join Date: Jan 2010
Posts: 63
Thanks: 2
Thanked 5 Times in 4 Posts
Mayhem30 is an unknown quantity at this point
Check for spammers using stopforumspam.com database

Check for spammers using stopforumspam.com database.

PHP Code:
function checkSpambots($mail,$ip)
{
    
$spambot false;

    
// check the e-mail adress
    
$xml_string file_get_contents('http://www.stopforumspam.com/api?email='.$mail);
    
$xml = new SimpleXMLElement($xml_string);
    if(
$xml->appears == 'yes')
    {
        
$spambot true;
    }
    elseif(
$spambot != true)
    {
        
// e-mail not found in the database, now check the ip
        
$xml_string file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
        
$xml = new SimpleXMLElement($xml_string);
        if(
$xml->appears == 'yes')
        {
            
$spambot true;
        }
    }
}


$spambot checkSpambots($_POST['email'],$_SERVER['REMOTE_ADDR']);
if(
$spambot == true)
{
    
// spambot detected ... do something ...

Mayhem30 is offline   Reply With Quote
Reply

Bookmarks

Tags
stop spam, stopforumspam

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:21 AM.


Advertisement
Log in to turn off these ads.