【发布时间】:2013-02-13 00:11:45
【问题描述】:
我想在我的服务器上完成处理后将用户重定向到远程服务器。有时,由于用户端的网络连接超时,重定向没有发生,导致他/她的页面没有更新状态。
我目前使用的是
header('Location: http://anotherwebsite.com');
如果失败,它不会再试一次……我怎样才能实现“将再试一次”的东西
$retry_limit = 0;
while(//http status code not 301 or 302 && $retry_limit < 3)
{
header('Location: http://anotherwebsite.com');
$retry_limit++;
}
如果我使用 cURL,我会感到困惑,如果我还实现了 header,它会双重重定向......或者我误解了它?
非常感谢!
【问题讨论】:
-
回溯中没有可用的信息吗? php debug_backtrace
-
你真的应该要求远程服务器操作员改善他们的正常运行时间......
标签: php curl http-headers http-redirect