Error in page redirection - PHP

0

I have a form that emails the message. It turns out that the code I have here does not seem to be working the redirect portion for confirmation page or upload error:

<?php

// Destinatário:
$para = "[email protected]";
// Assunto:
$assunto = "ASSUNTO X";
// Data de Envio:
$data_envio = date("d/m/Y h:i:s");

// Dados do Formulário:
$email = $_POST["email"];
$mensagem = "MSG X";
$mensagem .= "Enviado em $data_envio.";

$headers = "MIME-Version: 1.1\r\n"; 
$headers .= "Content-Type:text/html; charset=UTF-8\r\n";
$headers .= "From: $para\r\n";
$headers .= "Return-Path: $para\r\n";
$headers .= "Reply-To: $email\r\n";

$envio = mail($para, $assunto, $mensagem, $headers);

        if($envio) {
            header("location:respostaform_ok.html");
        }
        else {
            header("location:respostaform_erro.html");
        }       

?>

I can receive the message by email, but the user who sends the msg can not see the confirmation page.

Could anyone help? Thank you.

    
asked by anonymous 11.05.2018 / 22:14

1 answer

-2

You have with the full url of your site, instead of using:

header("location:respostaform_ok.html");

Use like this:

header("location:http://seu-site.com.br/respostaform_ok.html");
    
11.05.2018 / 22:20