Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/01/2009, 16:17
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: problemas con fecha y hora!!!!!!!!!!!

Pues puedes hacer:
Código php:
Ver original
  1. <input type="hidden" name="fecha" value="<?php echo date("Y-m-d"); ?>" />

Aunque realmente eso seria mas inseguro a que si insertas directo el valor en tu query, algo así:
Código php:
Ver original
  1. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  2. $insertSQL = sprintf("INSERT INTO notas (fecha, de, comentario) VALUES (%s, %s, %s)",
  3. date("Y-m-d"),
  4. GetSQLValueString($_POST['de'], "text"),
  5. GetSQLValueString($_POST['comentario'], "text"));
  6.  
  7. mysql_select_db($database_miconexion, $miconexion);
  8. $Result1 = mysql_query($insertSQL, $miconexion) or die(mysql_error());
  9.  
  10. $insertGoTo = "index.php";
  11. if (isset($_SERVER['QUERY_STRING'])) {
  12. $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
  13. $insertGoTo .= $_SERVER['QUERY_STRING'];
  14. }
  15. header(sprintf("Location: %s", $insertGoTo));
  16. }

Saludos