Script que se llama asi mismo
Publicado por DEVILSITO (140 intervenciones) el 10/05/2013 05:09:32
Esta pagina se llama a si misma (recursividad) al presionar la url "ok" , sin embargo, la variable $fecha insiste en traer la fecha cuyo dia es 9 ¿que estare haciendo mal?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html lang="es">
<head>
</head>
<body>
</div></div>
<form name='frm'>
<?php
if(isset($fecha)) {
$fecha = $_GET['fecha'];
}else{
$cadena =date("d/m/Y",time()-86400); // fecha actual
$tiempo = explode("/", $cadena); //
$fecha = '09' . "/" . $tiempo[1] . "/" . $tiempo[2];
}
?>
<input type="hidden" name="$fecha" value="<?php echo $fecha ;?>">
<input name="formtext1" id='fecha' type="text" <?php echo $fecha ?>'>
<a href='uf.php?fecha=<?php echo $fecha ?>'>Ok </a>
</form>
<?php
session_start();
require('param_conect.php');
$id = mysql_connect(host, user, pass, dbname);
mysql_select_db("central", $id);
$sql1 = "SELECT * FROM hrt_mavco where fecha_d >= '".$fecha."' order by fecha_d desc limit 30";
while($row = mysql_fetch_array($datos)) {
echo "<tr>" ;
$fecha = new DateTime($row['fecha_d']);
echo "<td>".date_format($fecha,'d-m-Y')."</td>\n";
echo "<td>".$row['valor_n']."</td>\n";
echo "</tr> \n";
}
?>
</body>
</html>
Valora esta pregunta


0