0

I'm using php for the first time with xamp and when I want to show the data of a form I show them clear this is not the problem, the problem lies when I want to transfer my project to a virtual machine with nginx stops working when I'm showing the information, I'm clear I'm using vagrant, the link of my project on github Github Code

using xamp, image:

enter image description here

when I give it send if I get the information in another tab:

enter image description here

and using vagrant with nginx and php is quite the opposite I don't see the information

enter image description here

after the submit: enter image description here

<?php
 require "User.php";


    if ( filter_has_var( INPUT_POST, 'submit' ) ) {

      $first_name = $_POST['first-name'];
      $last_name = $_POST['last-name'];
      $direction= $_POST['address'];
      $apt = $_POST['apt'];
      $country = $_POST['country'];
      $card_type = $_POST['card_name'];
      $card_number = $_POST['last-name'];
      $cvc = $_POST['cvc'];
      $month = $_POST['expire-month'];
      $year = $_POST['year'];

      $h = new User($first_name ,$last_name,$direction,$apt,$country
      ,$card_type,$card_number,$cvc,$month,$year);

      echo "Hello, " . $h->getFname(). "! You are ";
      jsLogs($h->getFname());

   }

   function jsLogs($data) {
    $html = "";
    $coll;

    if (is_array($data) || is_object($data)) {
        $coll = json_encode($data);
    } else {
        $coll = $data;
    }

    $html = "<script>console.log('PHP: ".$coll."');</script>";

    echo($html);
    # exit();
}


?>
body {
    background: rgba(33, 33, 33, 1) !important;
}

header {
    position: fixed;
    top: 0;
    z-index: 100;
    width: 100%;
}

.container {
    margin-top: 80px;
    text-align: center;
    align-items: center;
    align-content: center;
    background-color: transparent;
}

.container.dos {
    background-color: white;
    border-radius: 5px;
}

.card {
    padding: 25px;
}
<!DOCTYPE html>
<html lang="es">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel="stylesheet" href="./css/online_pago.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

    <link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.js"></script>
    <title>Document</title>
</head>

<body>
    <header>
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">

            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">


                    <li class="nav-item">
                        <a class="nav-link" href="#" id="click_cuatro">Inscripcion Web y metodo de pago</a>
                    </li>



                </ul>

            </div>
        </nav>
    </header>



    <div class="container text-center col-md-5">


        <!--Target Materia-->
        <div class="container dos">

            <div class="card">

                <form class="ui form" action="./php/index.php" method="POST">
                    <h2 class="ui dividing header">Informacion de Compra</h2>
                    <div class="field">
                        <label>Informacion de comprador</label>
                        <div class="two fields">
                            <div class="field">
                                <input id="nombre_uno" type="text" name="first-name" placeholder="Primer Nombre">
                            </div>
                            <div class="field">
                                <input id="nombre_dos" type="text" name="last-name" placeholder="Segundo Nombre">
                            </div>
                        </div>
                    </div>
                    <div class="field">
                        <label>Direccion Comprador</label>
                        <div class="fields">
                            <div class="twelve wide field">
                                <input id="direccion" type="text" name="address" placeholder="Direccion">
                            </div>
                            <div class="four wide field">
                                <input id="apartamento" type="text" name="apt" placeholder="Apt #">
                            </div>
                        </div>
                    </div>
                    <div class="two fields">

                        <div class="field">
                            <label>Pais</label>
                            <div class="default text">Selecciona Pais</div>
                            <select name="country" id="pais">
                                    <option value="">Selecciona uno</option>
                                    <option value="">Guatemala</option>
                                    <option value="">Belice</option>
                                    <option value="">Costa Rica</option>
                                    <option value="">Salvador</option>
                                </select>

                        </div>
                    </div>
                    <h4 class="ui dividing header">Informacion de comprador</h4>
                    <div class="field">
                        <label>Tipo de targeta</label>
                        <select name="card_name" id="tarjeta">
                            <option value="">Selecciona una opcion</option>
                            <option value="">Visa</option>
                            <option value="">Master Card</option>
                            <option value="">Paypal</option>
                        </select>
                    </div>
                    <div class="fields">
                        <div class="seven wide field">
                            <label>Numero de tarjeta</label>
                            <input id="numero" type="number" name="card_number" maxlength="16" placeholder="Tarjeta #">
                        </div>
                        <div class="three wide field">
                            <label>CVC</label>
                            <input id="cvc" type="text" name="cvc" maxlength="3" placeholder="CVC">
                        </div>
                        <div class="six wide field">
                            <label>Expiracion</label>
                            <div class="two fields">
                                <div class="field">
                                    <select id="mes" class="ui fluid search dropdown" name="expire-month">
                                        <option value="">Mes</option>
                                        <option value="1">Enero</option>
                                        <option value="2">Febrero</option>
                                        <option value="3">Marzo</option>
                                        <option value="4">Abril</option>
                                        <option value="5">Mayo</option>
                                        <option value="6">Junio</option>
                                        <option value="7">Julio</option>
                                        <option value="8">Agosto</option>
                                        <option value="9">Septiembre</option>
                                        <option value="10">Octubre</option>
                                        <option value="11">Noviembre</option>
                                        <option value="12">Diciembre</option>
                                    </select>
                                </div>
                                <div class="field">
                                    <input id="year" name="year" type="number" min="1900" max="2099" step="1" value="2016" placeholder="A&ntilde;o">
                                </div>
                            </div>
                        </div>
                    </div>
                    <h4 class="ui dividing header">Empaquetado</h4>

                    <div class="ui segment">
                        <div class="field">
                            <div class="ui toggle checkbox">
                                <input type="checkbox" name="gift" tabindex="0" class="show">
                                <label>Desea incluir empaquetado?</label>
                            </div>
                        </div>
                    </div>
                    <button type="submit" name="submit" class="btn btn-primary btn-block">Enviar</button>
                </form>
            </div>
        </div>

    </div>




</body>

</html>

Sorry to be so descriptive is that I had no other way to explain my problem to you, ied very much your help

Steven Colocho
  • 381
  • 1
  • 5
  • 15

0 Answers0