我有一份考试表格。但我想在给定的日期和时间内显示该表格。表示开始日期时间是2016-06-24 11:34:04,结束日期时间是2016-06-27 00:00:00如果在给定日期和时间之间有任何开放表格,表格应该打开否则它会去在另一个消息页面上。我有一个代码。但它不起作用。请帮忙。
<?php
include("connection.php");
date_default_timezone_set('Asia/Kolkata');
$timestamp = time();
$date_time = date("Y-m-d H:i:s", $timestamp);
$result=mysql_query("select * from activeform");
while($row=mysql_fetch_array($result))
{
extract($row);
if($date_time > '$startdate' and $date_time < '$enddate')
{
header("Location: myaccount.php");
}
else{
echo"date has been exceeds";
}
}
?>