* Google Safe Browse */ function google_sb_check($site, $api_key) { $msg = array( 'risk' => '... YOUR UNSAFE MESSAGE toward {SITE} {BODY} ...', 'safe' => '... YOUR __SAFE__ MESSAFGE toward {SITE} ... ', 'unknown' => '

{SITE} {BODY}

' ); $tpl = 'https://sb-ssl.google.com/safebrowsing/api/lookup?client=api&apikey='.$api_key.'&appver=vovo2000.com&pver=3.0&url=http://'; $body = file_get_contents($tpl.$site); $ary = explode(' ', $http_response_header[0]); $http_result = intval($ary[1]); switch ($http_result) { /* Risky */ case 200: $result = $msg['risk']; break; /* Safe */ case 204: $result = $msg['safe']; break; default: $result = $msg['unknown']; $body = $http_result.''; break; } $result = str_replace('{SITE}', $site, $result); $result = str_replace('{BODY}', $body, $result); return $result; } /* end google_sb_check */