After registering (in PDO), direct the page to index.html

0

I'm using HTML and PHP. The connection to the bank works, it registers the entered data and everything. Next, I open index.html, it has the option that takes me to the registration page:

<li><a href="http://localhost/middleearth/form-add.php">REGISTRAR</a></li>

This form-add.php shows me the form and register, and in a file called add.php, I open the connection for insertion in the bank. In this same add.php, I have:

header('Location: register_ok.php');

This register_ok.php informs you that the registration has been successful and gives the link to return to index.html:

<div id="options" class="container text-center">
<h2>CADASTRO</h2>
<p>Cadastro efetuado com sucesso! </p>
<a href="file:///C:/xampp/htdocs/middleearth/personagens.html">Ir para a Tela Inicial</a>
<br>

That's where my problem lives. I know it can be a very stupid thing to solve, but I just can not get it back to index.html so he can go back home and ask for login. I click on the link and it does not open. I have already tried using the header as well and nothing. The issue is, .php files accessed by the localhost / project folder do not seem to support this targeting for .html files. Can someone give me strength?

    
asked by anonymous 25.03.2017 / 06:35

1 answer

1

Do the following:

Check the flow of your application, they may not be loading because the flow upon being requested the page, it is not going through some script that was supposed to have passed.

Do not use this header('location'...) , if it is to call some page, use a require("register_ok.php")

When you use header() , make sure that no output has been sent yet.

    
25.03.2017 / 15:35