Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-日期调度_Php_Date_Input_Timer - Fatal编程技术网

PHP-日期调度

PHP-日期调度,php,date,input,timer,Php,Date,Input,Timer,您好,有没有办法根据输入日期锁定页面。例如,管理员输入2018年6月18日开始时间到2018年6月22日结束时间。某些用户的功能在开始时间之前被阻止或禁用,并在结束时间再次被禁用。不幸的是,我不能发布代码,因为我不知道怎么做。非常感谢任何帮助Hello once解决方案是您需要在php.ini中更改它并禁用_函数,但这对用户定义的函数没有意义,也无法在运行时更改,因此我希望您选择其他解决方案 <?php $startTime = strtotime('2008-09-22');

您好,有没有办法根据输入日期锁定页面。例如,管理员输入2018年6月18日开始时间到2018年6月22日结束时间。某些用户的功能在开始时间之前被阻止或禁用,并在结束时间再次被禁用。不幸的是,我不能发布代码,因为我不知道怎么做。非常感谢任何帮助

Hello once解决方案是您需要在php.ini中更改它并禁用_函数,但这对用户定义的函数没有意义,也无法在运行时更改,因此我希望您选择其他解决方案

<?php
    $startTime   = strtotime('2008-09-22');
    $endTime     = strtotime('2008-09-25');
    $now = new DateTime();
    $currentDate = $now->format('Y-m-d');
    $currentTime = $now->getTimestamp(); 

    function a(){
     if($currentTime>$startTime && $currentTime<$endTime){
       // in this scope this is enable so you can put logic here
     } else {
       // in this scope this is disable section so you can return error warning and false
        return false;
     }
    }
?>


在禁用部分,我可以禁用其中的页面吗?很抱歉,我不能理解这一切,我只是一个初学者。你可以在那里编写javascript代码,并使用标识符,如$(“#div”)。根据你的逻辑禁用(),再次是我。你能给我一个示例代码如何禁用div或页面吗?