Reputation: 103
I want to set min date to today but it doesnt work.
Can you please correct me?
My code:
echo '<input type="date" name="date" min="'.<?php echo date("Y-m-d"); ?>.'">';
thanks
Upvotes: 3
Views: 1632
Reputation: 789
Your date is not being printed into the input.
echo "<input type='date' name='date' min='".date('Y-m-d')."'>";
I also swapped the quotations so you could just use the variable within the echo without involving more.
Upvotes: 1
Reputation: 372
You don't need <?php
and ?>
inside already existing<?php ?>
tag.
<?php echo '<input type="date" name="date" min="' . date("Y-m-d") .' ">'; ?>
Upvotes: 6