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
  • 37,596
  • 11
  • 75
  • 105
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,033
  • 4
  • 46
  • 52
Nouphal.M
  • 6,320
  • 1
  • 15
  • 27
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
  • 370
  • 1
  • 4
  • 15