09Aug
Posted by admin as PHP
This PHP snippet creates a HTML datepicker and automatically selects the current date in the select boxes.
<?php
$current_month = date("m");
$current_day = date("d");
$current_year = date("Y");
?>
<select name="month">
<option value="01" <?php if($current_month == "01"){ echo "selected"; }
?>>January</option>
<option value="02" <?php if($current_month == "02"){ echo "selected"; }
?>>February</option>
<option value="03" <?php if($current_month == "03"){ echo "selected"; }
?>>March</option>
<option value="04" <?php if($current_month == [...]