我在我的网站上有一个付款的注册页面。该应用程序目前正在运行,但Center将在5个星期六进行一系列网络维护,每天大约4小时。
在这些日子里,在线收藏系统只能间歇性地使用。因此,我希望仅在这些特定日期和时间将我的注册页面重定向到其他页面。
对此有什么安全而简单的解决方案吗?
答案 0 :(得分:1)
由于我了解您的问题,您必须先定义维护时间。
$mainStage = 0;// Change this value with maintenance stage
$maintenanceTime = array(
0=>array('start'=>'5.00','end'=>'13.00'),
1=>array('start'=>'6.00','end'=>'12.00'));
if($maintenanceTime[$mainStage]['start'] < date('G.i') && $maintenanceTime[$mainStage]['end'] > date('G.i'))
header("location:maintenance/new/url");