Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SFSCheck($ip, $email = '')
- {
- ini_set('default_socket_timeout',15);
- $email = (!empty($email)) ? '&email=' . urlencode($email) : '';
- $SFSurl = 'http://www.stopforumspam.com';
- $SFSget = '/api?ip=' . $ip . $email . '&f=serial';
- if(ini_get('allow_url_fopen') == 1)
- {
- $SFSdata = @file_get_contents($SFSurl . $SFSget);
- }
- else
- {
- $fp = @fsockopen("www.stopforumspam.com", 80);
- if($fp)
- {
- $out = "GET " . $SFSget . " HTTP/1.0\r\n";
- $out .= "Host: www.stopforumspam.com\r\n";
- $out .= "Connection: Close\r\n\r\n";
- fwrite($fp, $out);
- while (!feof($fp))
- {
- $foo = fgets($fp);
- if(strpos($foo, 'a:') === 0)
- {
- $SFSdata = $foo;
- }
- }
- }
- else
- {
- $SFSdata = false;
- }
- }
- if($SFSdata === false)
- {
- return false;
- }
- else
- {
- $SFSdata = @unserialize($SFSdata);
- if($SFSdata !== false)
- {
- if(isset($SFSdata['ip']['confidence']))
- {
- // Do what you want to do with the ip confidence level
- }
- if(isset($SFSdata['email']['confidence']))
- {
- // Do whatever you want to do if there is an email confidence score
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement