function ICQStatus($uin) { $error_reporting = error_reporting(E_ERROR | E_PARSE); $fp = fsockopen('status.icq.com', 80, $errno, $errstr, 30); error_reporting($error_reporting); if (!$fp) return 'error'; $request = "HEAD /online.gif?icq=$uin&img=5 HTTP/1.0\r\n"; $request .= "Host: www.icq.com\r\n"; $request .= "Connection: close\r\n\r\n"; fputs($fp, $request); do { $response = fgets($fp, 1024); } while (!feof($fp) && !stristr($response, "Location")); fclose($fp); if (strstr($response, "online0")) return 'offline'; if (strstr($response, "online1")) return 'online'; if (strstr($response, "online2")) return 'deactivated'; return 'error'; }