Question

I want to add yahoo chat icon inside my website. To detect ID status (online/offline), and opening messenger tool, I've wrote the PHP codes below (given from a website). But it always returns ID is offline. Does Yahoo prevents checking status? What's the problem?

<?php
$yahoo_id = 'some_id';
$getstatus = file_get_contents('http://mail.opi.yahoo.com/online?u='.$yahoo_id.'&m=a&t=1');
switch($getstatus) {
    case "00": $status = '<img src="images/yahoo_offline.png" />';
    break;
    case "01": $status = '<a href="ymsgr:sendIM?'.$yahoo_id.'"><img src="images/yahoo_online.png" /></a>';
    break;
}
echo $status;
?>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top