How to check if IP adress is spammer [PHP]

We will check how to get information about IP using API. This can help stop harmfull servers do harm to your website.

  1. Add this code to your your PHP application, where you will check for spammers:
$ipadresstocheck = '';
$get = file_get_contents(''.$ipadresstocheck.'&confidence');
$arr = simplexml_load_string($get);
$ipappearsinspamdatabase = $arr->appears;
$lastseeninspamdatabase = $arr->lastseen;
$sfsconfidence = $arr->confidence;
  • Use $ipappearsinspammersdatabase¬†variable to check if IP adress appears in database.
  • Use $lastseeninspamdatabase variable to check when ip adress is last seen in database.
  • Use $sfsconfidence to get confidence scoring. Confidence scoring is statistically calculated score, based on the last seen date and the number of sightings.

More information about API usage.