<?php
$datetime=date("d-m-y");
$date1=date("d")+1;
$datetime1=date("$date1-m-y ");
$date1=$date1+1;
$datetime2=date("$date1-m-y ");
$date1=$date1+1;
$datetime3=date("$date1-m-y ");
echo $_POST['date1'];
echo $datetime1;
if($_POST['date1']==$datetime1)
{
header("location:bus2.php");
}
?>
此处如果条件不起作用,即使echo $_POST['date1'];
和echo $datetime1;
显示相同的结果。
答案 0 :(得分:7)
值 NOT 相同:
$datetime1=date("$date1-m-y ");
^--this space makes all the difference:
$_POST['date1'] = '14-02-2014';
$datetime1 = '14-02-2014 ';
^--- spot the difference