Este registro generado por Dreamweaber solo me deja registrar la fecha cuando coloco yyyy-mm-dd, pero yo quiero crear 3 input como por ejemplo:
Código HTML :
<input type="text" name="dia" value="" placeholder="Día" maxlength="2"> / <input type="text" name="mes" value="" placeholder="Mes" maxlength="2"> / <input type="text" name="ano" value="" placeholder="Año" maxlength="4">
Así quisiera que quedara. Mi código php y html es el siguiente:
Código PHP :
<?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 m_users (nombre, email, password, estado, nacimiento, sexo, avatar) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString(md5($_POST['password']), "text"),
GetSQLValueString($_POST['estado'], "int"),
GetSQLValueString($_POST['nacimiento'], "date"),
GetSQLValueString($_POST['sexo'], "int"),
GetSQLValueString($_POST['avatar'], "text"));
mysql_select_db($database_conexion, $conexion);
$Result1 = mysql_query($insertSQL, $conexion) or die(mysql_error());
$insertGoTo = "../index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>Código HTML :
<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="email" name="email" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Password:</td> <td><input type="password" name="password" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Nacimiento:</td> <td> <input type="text" name="nacimiento" value="" size="32" /> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Sexo:</td> <td valign="baseline"><table> <tr> <td><input type="radio" name="sexo" value="0" /> Hombre</td> </tr> <tr> <td><input type="radio" name="sexo" value="1" /> Mujer</td> </tr> </table></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="Insertar registro" /></td> </tr> </table> <input type="hidden" name="estado" value="1" /> <input type="hidden" name="avatar" value="default.jpg" /> <input type="hidden" name="MM_insert" value="form1" /> </form>
