Código PHP:
<html>
<head>
</head>
<body>
<form name=CMSFORM method=post>
<table width=100% border=1 align=center>
<?php
$day = date("d");
$moth = date("m");
$year= date("Y");
$cont=0;
$cont_day=1;
$stop=32;
$array=array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
?>
<!-- **** FECHA ***** -->
<tr>
<td align=right><b>Fecha de alquiler:</b></td>
<td>
<table border=1>
<tr>
<td align="center" width=100><b>Desde: </b></td>
<td align="right"> Año: </td>
<td width=100>
<select name="a_o">
<option value="A"><?php echo $year?></option>
<option value="B"><?php echo $year+1?></option>
</select>
</td>
<td align="right"> Mes: </td>
<td width=100>
<select name="mes">
<?php
while ($cont < 12) { ?>
<option value=<?php echo $cont. " "; if(($cont+1) == $moth){echo ("selected");}?>>
<?php echo $array[$cont];
$cont++; }?>
</option>
</select>
</td>
<td align="right"> Día: </td>
<td width=100>
<select name="dia">
<?php
if ($moth == 04 || $moth ==06 || $moth ==09 || $moth ==11) {
$stop=31;
}
if ($moth == 02) {
$stop=29;
}
while ($cont_day < $stop) { ?>
<option value=<?php echo $cont_day. " "; if(($cont_day) == $day){echo ("selected");}?>>
<?php echo $cont_day;
$cont_day++; }?>
</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<!-- **** FECHA ***** -->
<?php
$cont=0;
$cont_day=1;
$stop=32;
?>
<tr>
<td></td>
<td>
<table border=1>
<tr>
<td align="center" width=100><b>Hasta: </b></td>
<td align="right"> Año: </td>
<td width=100>
<select name="a_o2">
<option value="A2"><?php echo $year?></option>
<option value="B2"><?php echo $year+1?></option>
</select>
</td>
<td align="right"> Mes: </td>
<td width=100>
<select name="mes2">
<?php
while ($cont < 12) { ?>
<option value="2"<?php echo $cont. " "; if(($cont+1) == $moth){echo ("selected");}?>>
<?php echo $array[$cont];
$cont++; }?>
</option>
</select>
</td>
<td align="right"> Día: </td>
<td width=100>
<select name="dia2">
<?php
if ($moth == 04 || $moth ==06 || $moth ==09 || $moth ==11) {
$stop=31;
}
if ($moth == 02) {
$stop=29;
}
while ($cont_day < $stop) { ?>
<option value=<?php echo $cont_day. " "; if(($cont_day) == $day){echo ("selected");}?>>
<?php echo $cont_day;
$cont_day++; }?>
</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<!-- **** FECHA ***** -->
</table>
</body>
</html>