No data sent by post in php

0

Hello friends, my problem is very simple

I have this in my html form that I sent through the form with post method

<form method="post" action="../Clase/RegistroCrud.php">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Rut</label>
                         <input type="text" class="form-control" name="TxtRut" value="">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Nombre y Apellido</label>
                        <input type="text" class="form-control" name="TxtNombre" placeholder="Pedro Gutierrez" value="">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Numero de telefono</label>
                        <input type="number" class="form-control" name="TxtNumTel" placeholder="+569 123456789" value="">
                    </div>

                </div>
                <div class="col-md-4">
                <div class="form-group">
                    <label for="exampleInputEmail1">Persona a Quien Visita</label>
                    <input type="text" class="form-control" name="TxtPersVis" placeholder="Juan Valdez">
                </div>
                <div class="form-group">
                    <label for="exampleInputPassword1">Area de visita</label>
                    <select class="form-control">
                        <option id="1">1</option>
                    </select>
                </div>

                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Hora de entrada</label>
                        <input type="datetime" class="form-control" name="txtHoraIn" value="<?php echo date('d-m-Y G:i');?>">

                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Hora de salida</label>
                        <input type="datetime" class="form-control" name="txtHoraOut" value="<?php echo date('d-m-Y G:i');?>">
                    </div>
                </div>
                <div class="col-md-4">
                    <label>¿Entrega Tarjeta?</label>
                    <div class="radio">
                        <label><input type="radio" name="rbt" id="S" value="rdbSi" onclick="Show('DivsPrueba')"  checked value="S">Si</label>
                        <label><input type="radio" name="rbt" id="N" value="rdbNo" onclick="hide('DivsPrueba')" value="N">No</label>
                    </div>

                </div>
                <div class="col-md-4" >
                    <div class="form-group" id="DivsPrueba" >
                        <label for="exampleInputEmail1">Numero de tarjeta </label>
                        <input type="text" class="form-control" name="txtNumTarj" value="">
                    </div>
                </div>
            </div>

        </div>
        <input type="submit" class="btn btn-success btn-lg" id="btnGuardar" value="Guardar">
    </form>

And this in my registryCrud.php

<?php

   include "../Conexion/conex.php";

   openConx();

   $Rut = $_POST['TxtRut'];
   $nombre= $_POST['TxtNombre'];
   $PersVis= $_POST["TxtPersVis"];

good so with all the inputs, the issue is that I get the following error

  

Notice: Undefined index: TxtRut in C: \ xampp \ htdocs \ System Registry \ Class \ RegistryCrud.php on line 12

     

Notice: Undefined index: TxtName in C: \ xampp \ htdocs \ System Registry \ Class \ RegistrationCrud.php on line 13

     

Notice: Undefined index: TxtPersVis in C: \ xampp \ htdocs \ System Registry \ Class \ RegistryCrud.php on line 14

    
asked by Pablo Moraga 21.08.2017 в 21:34
source

1 answer

1

Verify your parameters that you are receiving

if (isset($_POST["TxtRut"]) && !empty($_POST["TxtRut"])) {
    echo $_POST["TxtRut"];    
}else{  
    echo "no hay datos para mostrar";
}
    
answered by 21.08.2017 / 21:55
source