CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Post a PHP snippet (http://www.codingforums.com/forumdisplay.php?f=41)
-   -   Check for spammers using stopforumspam.com database (http://www.codingforums.com/showthread.php?t=267183)

Mayhem30 07-05-2012 08:48 PM

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 ...




All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.