$cSession = curl_init();
curl_setopt($cSession,CURLOPT_URL,"http://api.stopforumspam.org/api?username=".$username."&email=".$email."&f=xmldom");
curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);
curl_setopt($cSession,CURLOPT_HEADER, false);
$result=curl_exec($cSession);
curl_close($cSession);
$confidencecheck = explode("<confidence>",$result);
$confidencefinal = explode("</confidence>",$confidencecheck[1]);
$cutoff = 80; //change this to any value you want but higher means fewer false positives
$confidence = $confidencefinal[0];
if($confidence == "") $confidence = '0';
if($confidence > $cutoff)
{
setcookie("spammer", "true");
header("Location: http://some-annoying-site.com");
exit;
//echo "would not proceed with reg";
}elseif($confidence == "" || $confidence == NULL){
//echo "would proceed with reg due to fail-safe reg"; //left this here for future expansion such as further scrutiny required for unknown reg
}else{
//echo "would proceed with reg pass check"; //left this here for future expansion
}
|