1

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

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
himmerz
  • 69
  • 5

2 Answers2

5

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

instead of this :

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

try

value="<?php echo $currentDate ?>"
Fleshgrinder
  • 15,703
  • 4
  • 47
  • 56
Nouphal.M
  • 6,304
  • 1
  • 17
  • 28
1

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?>" />
Ryan Hendry
  • 389
  • 1
  • 5
  • 16