2010-06-25 73 views
0

我正在使用http类,它坚持在它所说的函数setcookies的行上设置cookie。http.php中的最大执行时间为30秒

这是我的代码

require_once ('../http.php'); 
$http=new http_class; 
$http->user_agent="Mozilla/5.0 (Intel Mac OS X) Gecko/20070515 Firefox/2.0.0.4"; 
$error=$http->GetRequestArguments($url,$arguments); 

foreach ($cookie as $c) { 
$t = explode('=',$c);       
$http->SetCookie($t[0],$t[1],"","/",".example.com"); //problem is here i think 
} 

$arguments["Headers"]["Referer"] = $referer; 
+2

问题是什么,标题与代码有什么关系? – Gordon 2010-06-25 09:49:06

回答

-1

我假设你,因为你的脚本运行时间过长得到一个错误。您可以取消该限制是这样的:

set_time_limit(0); 

另见http://php.net/set_time_limit以获取更多信息。

+1

如果在显示的代码中发生超时,那么在代码或配置中会出现**错误。禁用超时不解决问题。 – symcbean 2010-06-25 12:03:39

0

您能提供$http->SetCookie(...)的信息来源?为什么你的http_class课程中有SetCookie方法?输入参数列表与PHP的setcookie完全一样,为什么不使用它呢?

相关问题