Php 如何在我选择的时间段内刷新wordpress插件?
我为wordpress写了一个插件,我希望它每3小时刷新一次,但我没有得到任何结果Php 如何在我选择的时间段内刷新wordpress插件?,php,wordpress,Php,Wordpress,我为wordpress写了一个插件,我希望它每3小时刷新一次,但我没有得到任何结果 谢谢你的帮助 您可以尝试使用javascript: setTimeout(function(){ window.location = 'example.com' },10800) 让我们知道您在3个半小时左右的时间内进展如何…您已经混淆了PHPheader()函数和HTML HEAD部分 PHP标题('Location:newpage.htm')执行到newpage.htm的即时重定向(并应直接在调用die()
谢谢你的帮助 您可以尝试使用javascript:
setTimeout(function(){ window.location = 'example.com' },10800)
让我们知道您在3个半小时左右的时间内进展如何…您已经混淆了PHP
header()
函数和HTML HEAD部分
PHP标题('Location:newpage.htm')代码>执行到newpage.htm的即时重定向(并应直接在调用die()
之后)。没有可能延迟重定向
在HTML代码>部分,您可以使用元标记执行延迟刷新或重定向:
<!-- Refresh the Current Page every 10 minutes (600 seconds) //-->
<meta http-equiv="refresh" content="600">
<!-- Redirect to Another Page with a Delay of 10 minutes (600 seconds) //-->
<meta http-equiv="refresh" content="600;url=http://anotherserver.com/">