Get input type data with php

0

Can someone help me get data from an input type date?;

<form id="Formulario" method="post"><br>
    <label style="display:block; overflow:hidden;">Fecha de nacimiento</label>
    <input type="date" id="fecha" name="Fecha"  min="2018-03-25" max="2018-05-25" step="2">
    <input type="submit" name="Insertar" class="" style="margin-left:20px; margin-top:20px;" value="Insertar Registro">
</form>
    
asked by Denzel Silva Torrico 05.09.2018 в 06:21
source

1 answer

1

The problem is that you do not tell what file you send the data to, in summary you lack the action: Here is corrected.

                  

<form class="" action="recibe.php" method="post">
    <label style="display:block; overflow:hidden;">Fecha de nacimiento</label>
    <input type="date" id="fecha" name="Fecha"  min="2018-03-25" max="2018-05-25" step="2">
    <input type="submit" name="Insertar" class="" style="margin-left:20px; margin-top:20px;" value="Insertar Registro">
</form>

Php code to receive the variable:

$ date = $ _POST ['Date'];
echo $ date;

I advise you not to capitalize the name, as it can lead you to confusion.

pd: if you do not put the action the default values are sent to the same file, but to receive them you have to create it in .php format and not .html

luck!

    
answered by 05.09.2018 в 15:48