Code used to determine whether ICQ is online. Code to determine whether ICQ is online: functionget_status ($ uin) {$ fpfsockopen (wwp.icq.com, 80, $ errstr, 30); if (! $ Fp) {echo $ errstr ($ errno);} else {fputs ($ fp, GETscript // code used to determine whether ICQ is online
Function get_status ($ uin)
{
$ Fp = fsockopen ("wwp.icq.com", 80, & $ errno, & $ errstr, 30 );
If (! $ Fp)
{
Echo "$ errstr ($ errno)
";
}
Else
{
Fputs ($ fp, "GET/scripts/online. dll? Icq = $ uin & img = 5 HTTP/1.0 ");
$ Do = yes;
While (! Feof ($ fp ))
{
$ Line = fgets ($ fp, 128 );
$ Do = ($ do = yes )? Yes :( eregi ("^ GIF89", $ line ))? Yes: no;
// Echo $ line;
If ($ do = yes)
{
If (ereg ("@", $ line ))
{
Return online;
}
Elseif (ereg ("example", $ line ))
{
Return offline;
}
Elseif (ereg ("S", $ line ))
{
Return disabled;
}
}
}
Fclose ($ fp );
}
Return unknown !;
}
$ Uin = "72485936"; // sonymusic's ICQ, huh, huh.
Echo get_status ($ uin );
// Offline
?>
Using function get_status ($ uin) {$ fp = fsockopen ("wwp.icq.com", 80, $ errstr, 30); if (! $ Fp) {echo "$ errstr ($ errno)";} else {fputs ($ fp, "GET/script...