PDA

View Full Version : làm thế nào khắc phục lỗi execution time



neo063
31-12-2007, 15:22
Mình thực hiện kiểm tra nick online trên 1 danh sách được load dưới csdl, nhưng khi thự thi thì hàm kiểm tra của mình lại bị lỗi execution time... Các bạn fix giùm mình.. thanks.. nó thường hay bị lỗi ngay dòng: $lines = @file ("http://opi.yahoo.com/online?u=" . $yahoo . "&m=t");

Đây là hàm check:
function execute ($yahoo = "", &$errno, &$errstr)
{
$errno = 0;
$errstr = "";
$lines = @file ("http://opi.yahoo.com/online?u=" . $yahoo . "&m=t");
if ($lines !== false) {
$response = implode ("", $lines);
if (strpos ($response, "NOT ONLINE") !== false) {
return YAHOO_OFFLINE;
} elseif (strpos ($response, "ONLINE") !== false) {
return YAHOO_ONLINE;
} else {
return YAHOO_UNKNOWN;
}
} else {
$errno = 1;
$errstr = "Unable to connect to http://opi.yahoo.com";
return false;
}
}

dungpt2003
31-12-2007, 16:12
Tăng thời gian thực thi script nên: set_time_limit & giảm số lượng user cần kiểm tra đi