我想在Php中寻找一种方法让重定向在所述日期到期。
这用于我使用下面的代码在服务器上共享文件。 我喜欢的是让重定向将它们带到一个页面,让他们知道时间已经结束,他们可以看到重定向或告诉我更新过期日期。
if (test){
---do something---
die("<script>location.href = 'http://file.here.com'</script>");
} else {
return false;
}
我也试过
function BeforeProcessList(&$conn, &$pageObject)
{
$target_date = new DateTime("05-01-2014");
$today = new DateTime();
if((int)$target_date->diff($today)->format('%r%a') >= 0)
{
header("Location: testview_list.php");
exit();
}
}