Search Keyword:

Posts Tagged ‘Date picker PHP snippet

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 == [...]


Sponsored Links



Recent Comments

  • Alex13: Hi! thanks for this great post and code. I found a problem with it and need your help: I have in my form an...
  • Krishnakiran: Do anyone have a sample code for this
  • Paul: Nice, that is exactly what I was looking for, thanks!
  • Czek: can i use this with php uploads? my server does not support APC or Pecl upload progress..i need to provide user...
  • anup: thanx it helped me alot…