Good morning, I am working on a project using HTML5 and PHP, in this project I have the option to register people, in which they are asked for general information such as names, surnames, date of birth, etc., for the date of birth, use a input type Date to show me a calendar in the form, if it works, now I have another form in which I can update the information of the person has been registered, in that form all the previously entered data are loaded and placed in the textbox automatically, but I want the date to automatically appear in the input type date to register without having to put it back, any ideas?
I leave here my PHP code
echo "WORKS; /
$id = $_GET["id"]; $stmt = $mbd->prepare("CALL sp_getdataupdate(?)"); $stmt->bindparam(1, $id, PDO::PARAM_INT); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); $stmt = null; /* $fecha = $result['fecha_nacimiento']; $fecha1 = split("/",$fecha); $fechaf = $fecha1[0]."-".$fecha1[1]."-".$fecha1[2]; //$fechaf; //var_dump($result); */ }
if (isset ($ _ POST ["update"])) { / echo "WORKS; / $ stmt = null;
$curp = $_POST["curp"];
$nombres = $_POST["nombres"];
$apellido_paterno = $_POST["apellidop"];
$apellido_materno = $_POST["apellidom"];
$fecha_nacimiento = $_POST["nacimiento"];
$sexo = $_POST["sexo"];
$calle = $_POST["calle"];
$numero_exterior = $_POST["numex"];
$numero_interior = $_POST["numint"];
$codigo_postal = $_POST["cp"];
$colonia = $_POST["colonia"];
$estatus = $_POST["estatus"];
$delegacion = $_POST["delegacion"];
$id = $_POST["id"];
$stmt = $mbd->prepare("CALL sp_actualizarregistros(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $stmt->bindparam(1, $curp, PDO::PARAM_STR); $stmt->bindparam(2, $nombres, PDO::PARAM_STR); $stmt->bindparam(3, $apellido_paterno, PDO::PARAM_STR); $stmt->bindparam(4, $apellido_materno, PDO::PARAM_STR); $stmt->bindparam(5, $fecha_nacimiento, PDO::PARAM_STR); $stmt->bindparam(6, $sexo, PDO::PARAM_STR); $stmt->bindparam(7, $calle, PDO::PARAM_STR); $stmt->bindparam(8, $numero_exterior, PDO::PARAM_STR); $stmt->bindparam(9, $numero_interior, PDO::PARAM_STR); $stmt->bindparam(10, $codigo_postal, PDO::PARAM_STR); $stmt->bindparam(11, $colonia, PDO::PARAM_STR); $stmt->bindparam(12, $estatus, PDO::PARAM_STR); $stmt->bindparam(13, $delegacion, PDO::PARAM_STR); $stmt->bindparam(14, $id, PDO::PARAM_INT); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); var_dump($result); if (isset($result["Mensaje"])) { echo "ERROR AL REGISTRAR!"; } else { echo "CORRECTO"; } } ?>