【问题标题】:how to refresh a page in php using php background process? Is there ajax backround Process?如何使用php后台进程刷新php中的页面?有ajax后台进程吗?
【发布时间】:2010-06-17 04:47:32
【问题描述】:

如何使用php后台进程每10分钟刷新一次页面? 当我登录到我的帐户时,我可以检查我的消息,在设置超时功能时,页面每 10 分钟重新加载一次,但我需要该进程在后台运行, 在我登录后,.. 如果我收到一些消息,我必须收到一个名为 hai 的弹出窗口,您有来自此发件人的消息

【问题讨论】:

    标签: php process background


    【解决方案1】:

    由于多种原因,我唯一理解的是每 10 分钟刷新一次。你不能使用php,你必须像这样使用javascript:

    <body onload="setInterval('window.location.reload()', 600000);">
    

    【讨论】:

    • 如果页面在填写表格时重新加载,那么我会很乱
    • @udaya :是的,不管你如何选择重新加载,都会发生这种情况。
    【解决方案2】:

    您可以使用 PHP 向客户端发送标头

    header("refresh:600"); //600 seconds = 10 minutes
    

    【讨论】:

      猜你喜欢
      • 2011-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-27
      • 2010-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多