El Formulario:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
</label>
<table width="90%" border="0">
<tr>
<td align="right">Iniciar:</td>
<td align="left" class="style1"><label>
<?
if(trim($_POST['fechaini']) != ""){
$fechacal=htmlentities($_POST['fechaini']);
}else{
$fechacal="Elejir Fecha >>";
}
?><input type="text" name="fechaini" id="fechaini" value="<?php echo $fechacal; ?>" />
</label>
<label>dd/mm/yyyy</label></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left" class="style1"><?php if ($_POST['MM_Insert'] == "form1"){ ?>
<?php echo validarfechas($_POST['fechaini'],$_POST['fechafin'],"1",""); ?>
<?php } ?></td>
</tr>
<tr>
<td align="right">Finalizar:</td>
<td align="left" class="style1"><label>
<?
if(trim($_POST['fechaini']) != ""){
$fechacal2=htmlentities($_POST['fechafin']);
}else{
$fechacal2="Elejir Fecha >>";
}
?><input type="text" name="fechaini" id="fechaini" value="<?php echo $fechacal; ?>" />
</label>
<label>dd/mm/yyyy</label></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left" class="style1"><?php if ($_POST['MM_Insert'] == "form1"){ ?>
<?php echo validarfechas($_POST['fechaini'],$_POST['fechafin'],"2",""); ?>
<?php } ?></td>
</tr>
</table>
<p>
<label>
<input type="submit" name="button" id="button" value="Enviar" />
</label>
<input type="hidden" name="MM_Insert" id="MM_Insert" value="form1" />
</p>
</form>
</body>
</html>