在表单中的php中显示当前日期

I can't get the following to work, been trying ages now :(

Day: <input type="date" name="Day" value=""<?php $currentDate;?>"" /> 


Day: <input type="date" name="Day" value="2014-02-11" /> 

The second one works fine but the first one won't. Thanks

you have a quotes problem and you are not echoing the value

instead of this :

value=""<?php $currentDate;?>""

try

value="<?php echo $currentDate ?>"

If you haven't yet defined the current date you can use:

Day: <input type="date" name="Day" value="<?=date('Y-m-d')?>" />

Otherwise:

Day: <input type="date" name="Day" value="<?=$currentDate?>" />