Data is not saving

1

I've created a project that contains the admin part that selects the hours to be available to the client and has the contact page when I first go to admin and I select the times and click on update (button I created) it goes to contact page and the times I select ... the moment I click on the home page and then I go back to the contact page the times I've selected are no longer there ... my question is, should it be why I'm locally and why it happens?

I am afraid that I will be hosting the site and the problem is still going on, because the hours that I have selected are not appearing right after I have browsed my site ....

PHP code and the page that receives the data:

      <div class="container">
        <div class="row">
            <div class="campo-externo">
                <div class="caixa-registrado col-lg-12">
                    <p>Marca uma visita agora!</p>

                    <form>
                        <div class="row">
                            <div class="col-lg-6">
                                <input class="detalhe-campo-velho" type="text" placeholder="Nome">
                            </div>


                            <div class="col-lg-6">
                                <input class="detalhe-campo-velho" type="number" placeholder="Codigo de segurança">
                            </div>

                        </div>
                        <hr />

                        <form>
                            <div class="campo-agenda-novo">
                                <p class="texto-centro">Agenda disponível</p>

                                <div class="row">
                                    <div class="col-lg-12 texto-centro">

                                <?php 

                                        if(isset($_POST["hora"])) {


                                            for($i = 0; $i < count($_POST["hora"]); $i++) {


                                    echo " ".$_POST["hora"] [$i]." <input type='radio'/> </br>";

                                    }                                                          
                                        }
                                ?>


                                    </div>
                                </div>
                                <hr />
                            </div>
                        </form>

                        <div class="texto-centro">
                            <button class="botao-confir margin-top20">Confirmar</button>
                        </div>
                    </form>

                </div>
            </div>

        </div>
        <hr class="linha-cinza" />
    </div>

Admin page:

<form method="post" action="agendamento.php">
    <div class="row texto-centro">
        <div class="col-lg-12 texto-centro">
            <span>10:00</span>
            <input type="checkbox"  id="blankRadio1" value="10:00" name="hora[]" aria-label="..." ng-model="um">
            <br />
            <span>10:30</span>
            <input type="checkbox"  id="blankRadio1" value="10:30"  name="hora[]" aria-label="..." ng-model="dois">
            <br />
            <span>11:00</span>
            <input type="checkbox"  id="blankRadio1" value="11:00" name="hora[]" aria-label="..." ng-model="tres">
            <br />
            <span>11:30</span>
            <input type="checkbox"  id="blankRadio1" value="11:30" name="hora[]" aria-label="..." ng-model="quatro">
            <br />
            <span>13:00</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="13:00" aria-label="..." ng-model="cinco">
            <br />
            <span>13:30</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="13:30" aria-label="..." ng-model="seis">
            <br />
            <span>14:00</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="14:00" aria-label="..." ng-model="sete">
            <br />
            <span>14:30</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="14:30" aria-label="..." ng-model="oito">
            <br />
            <span>15:00</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="15:00" aria-label="..." ng-model="dez">
            <br />
            <span>15:30</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="15:30" aria-label="..." ng-model="onze">
            <br />
            <span>16:00</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="16:00" aria-label="..." ng-model="doze">
            <br />
            <span>16:30</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="16:30" aria-label="..." ng-model="treze">
            <br />
            <span>17:00</span>
            <input type="checkbox" name="hora[]" id="blankRadio1" value="17:00" aria-label="..." ng-model="quatorze">
            <br />
        </div>
    </div>

    <div class="row texto-centro margin-top20">
        <button ng-click="atualizar()" value="descobrir">Atualizar</button>

    </div>
</form>

Someone could explain to me how it works ... I know that to send e-mail through php it requires that the site is hosted, since this method I did not know if the site needs to be hosted. >     

asked by anonymous 23.12.2016 / 05:36

1 answer

2

Your page that receives data is using $ _POST to display the selected times. The $ _POST variable only exists when you send it from a form (values entered in the input fields). If you go from the Home-> page that receives data, the $ _POST variable will not be set, so you will not have what to display.

    
23.12.2016 / 18:06