Introducir datos jQuery datepicker en BD con php
Hola Zeus Necesito me ayudes con un tema.Estoy siguendo tu tutorial de responsive adaptandolo aun proyecto de mi web.
El problema es en el formulario de registro para insertar la fecha mediante un jQuery datepicker en la BD.
Como recupero ese dato y lo paso a una varible ej:
$fechaformatoingles= date('Y-m-d', strtotime($_POST['fecha']))); para transformar el formato y lo recupero en el formulario y lo paso a la BD. Todo hecho con dreamweaver.Ojalá puedas ayudarme ya que me estoy volviendo loco
Adjunto códiog de la página :
El problema es en el formulario de registro para insertar la fecha mediante un jQuery datepicker en la BD.
Como recupero ese dato y lo paso a una varible ej:
$fechaformatoingles= date('Y-m-d', strtotime($_POST['fecha']))); para transformar el formato y lo recupero en el formulario y lo paso a la BD. Todo hecho con dreamweaver.Ojalá puedas ayudarme ya que me estoy volviendo loco
Adjunto códiog de la página :
<?php $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO tblusers (nombre, email, password, estado, avatar, pais, ciudad, fecha) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['nombre'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString(md5($_POST['estado']), "int"), GetSQLValueString($_POST['avatar'], "text"), GetSQLValueString($_POST['pais'], "int"), GetSQLValueString($_POST['ciudad'], "int"), GetSQLValueString($_POST['fecha'], "date")); mysql_select_db($database_conexionwhatoo, $conexionwhatoo); $Result1 = mysql_query($insertSQL, $conexionwhatoo) or die(mysql_error()); $insertGoTo = "verificacion.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Nombre:</td> <td><input type="text" name="nombre" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Email:</td> <td><input type="text" name="email" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Password:</td> <td><input type="text" name="password" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Pais:</td> <td><input type="text" name="pais" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Ciudad:</td> <td><input type="text" name="ciudad" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Fecha:</td> <td><input type="text" name="fecha" id="fecha" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td align="right"><br /> <input type="submit" value="Registrarme" /></td> </tr> </table> <input type="hidden" name="estado" value="" /> <input type="hidden" name="avatar" value="" /> <input type="hidden" name="MM_insert" value="form1" /> </form>
<script type="text/javascript"> $(function() { $('#fecha').datepicker({dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: '-100:+0'}); }); </script>
0
Puntos
Puntos
3610
Visitas
Visitas
3
Resp
Resp
Por etobcn hace 130 meses
Principiante
Respuesta #1
buenas.. no te puedo decir por que todavia no eh utilizado datepicker tendria que hacer testeos para ver como funciona y ahora me es imposible, espera un poco a que se pasen despues mas colaboradores a ver si alguien te responde correctamente
un saludo!
un saludo!
Respuesta #2
en este artículo se explica a la perfección, espero que te sirva http://blog.rocatic.com/2012/07/jquery-datepicker-php-mysql-y-las-fechas-en-formato-espanol/
0
Puntos
Puntos
Por alber hace 123 meses
Administrador
Respuesta #3
hola buen dia, me puedes colaborar con los archivos datepicker etobcn
0
Puntos
Puntos
Por Juliethsanches hace 80 meses
Principiante