We will check how to get information about IP using stopforumspam.com API. This can help stop harmfull servers do harm to your website.
- Add this code to your your PHP application, where you will check for spammers:
$ipadresstocheck = '184.108.40.206'; $get = file_get_contents('https://www.stopforumspam.com/api?ip='.$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 stopforumspam.com 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.