Ver Mensaje Individual
  #10 (permalink)  
Antiguo 07/10/2008, 06:38
adibu
 
Fecha de Ingreso: septiembre-2007
Mensajes: 50
Antigüedad: 16 años, 7 meses
Puntos: 0
Respuesta: Problemas con la fecha

Estimado Jaronu.

Siento molestarte y te agradezco que te tomes tanto interés por resolver mi problema.

Para que veas un ejemplo de lo que quiero es una página del tipo de:
http://www.instalareforma.com/ultpre.php

En la que las fechas que aparecen son las del día en que se ha enviado el formulario.

Con la solución que tú me has dado el formulario me queda:

Nombre y Apellidos:
Dirección
Teléfono:
Email:
Inicio de la obra: 2008-10-07
Localidad de la obra:
Provincia de la obra:
Código Postal:
Obra a realizar:
(Ej:Reformar piso)
Descripción de la obra:

En la casilla de inicio de la obra se me pone directamente la fecha de hoy y eso no es lo que quiero.
Las casillas del formulario deben quedar todas vacías.
Las debe rellenar la persona que quiere realizar la obra, esos datos van a una tabla de mi base de datos de nombre: general
Esa tabla tiene un campo que se llama fecha que no se rellena con ningún dato de los que ha puesto la persona que rellena el formulario, sino que en ese campo debe aparecer la fecha del día en que se ha rellenado el formulario y en el formato español día-mes-año como aparece en la página que te indicaba de ejemplo.

Te envío, según me pides, el código de la página que hace la consulta a la base de datos (en la que debe figurar la fecha que tanta guerra nos da)


<?php require_once('Connections/conexionconsultas.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_ver = 20;
$pageNum_ver = 0;
if (isset($_GET['pageNum_ver'])) {
$pageNum_ver = $_GET['pageNum_ver'];
}
$startRow_ver = $pageNum_ver * $maxRows_ver;

mysql_select_db($database_conexionconsultas, $conexionconsultas);
$query_ver = "SELECT * FROM `general`";
$query_limit_ver = sprintf("%s LIMIT %d, %d", $query_ver, $startRow_ver, $maxRows_ver);
$ver = mysql_query($query_limit_ver, $conexionconsultas) or die(mysql_error());
$row_ver = mysql_fetch_assoc($ver);

if (isset($_GET['totalRows_ver'])) {
$totalRows_ver = $_GET['totalRows_ver'];
} else {
$all_ver = mysql_query($query_ver);
$totalRows_ver = mysql_num_rows($all_ver);
}
$totalPages_ver = ceil($totalRows_ver/$maxRows_ver)-1;

$queryString_ver = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_ver") == false &&
stristr($param, "totalRows_ver") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_ver = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_ver = sprintf("&totalRows_ver=%d%s", $totalRows_ver, $queryString_ver);
?><!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=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="760" align="center">
<tr>
<th width="120" scope="col">fecha</th>
<th width="333" scope="col">reforma</th>
<th width="181" scope="col">localidad</th>
<th width="106" scope="col">provincia</th>
</tr>
<?php do { ?>

<tr>

<td><div align="center"><?php echo $row_ver['Fecha']; ?></div></td>

<td><div align="center"><a href="datos_cliente.php?Id=<?php echo $row_ver['Id']; ?>" target="_blank"><?php echo $row_ver['reforma']; ?></a></div></td>
<td><div align="center"><a href="datos_cliente.php?Id=<?php echo $row_ver['Id']; ?>" target="_blank"><?php echo $row_ver['Localidad']; ?></a></div></td>
<td><div align="center"><a href="datos_cliente.php?Id=<?php echo $row_ver['Id']; ?>" target="_blank"><?php echo $row_ver['Provincia']; ?></a></div></td>
</tr>
<?php } while ($row_ver = mysql_fetch_assoc($ver)); ?>
</table>
<br />
<table width="760">
<tr>
<td width="78"><?php if ($pageNum_ver > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_ver=%d%s", $currentPage, max(0, $pageNum_ver - 1), $queryString_ver); ?>" target="_blank">Anterior</a>
<?php } // Show if not first page ?> </td>
<td width="589">&nbsp;</td>
<td width="77"><?php if ($pageNum_ver < $totalPages_ver) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_ver=%d%s", $currentPage, min($totalPages_ver, $pageNum_ver + 1), $queryString_ver); ?>" target="_blank">Siguiente</a>
<?php } // Show if not last page ?> </td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result($ver);
?>





Saludos