No funciona header("location:pagina.php");
Publicado por Walter (1 intervención) el 10/06/2019 02:41:44
Por favor quiero redireccionar a una pagina de gracias cuando se envie el formulario, pero no se donde poner header("location:pagina.php");. Por favor su ayuda. Tanscribo el codigo del archivo php para enviar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
if (isset($_POST['fname'])){
$nombres=htmlentities($_POST['fname']);
$email_cliente=htmlentities($_POST['email']);
$telefono=htmlentities($_POST['phone']);
$subject=utf8_decode($_POST['subject']);
$mensaje=htmlentities($_POST['message']);
/*SIGUE RECOLECTANDO DATOS PARA FUNCION MAIL*/
$message = '';
$message .= '<p>Han solicitado informacion desde la pagina Pensamiento Objetivo:</p> ';
$message .= '<p>Cliente: '.$nombres.'</p> ';
$message .= '<p>Email: '.$email_cliente.'</p> ';
$message .= '<p>Teléfono: '.$telefono.'</p> ';
$message .= '<p>Mensaje: '.$mensaje.'</p> ';
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=UTF-8\r\n";
$header .= "From: ". $nombres . " <" . $email_cliente . ">\r\n";
$email='info@notar.net';//Ingresa tu dirección de correo
if (mail($email,$subject,$message,$header)){
echo 'success';
} else {
echo 'No se pudo enviar el mensaje.';
}
/*FINALIZA RECOLECTANDO DATOS PARA FUNCION MAIL*/
}
?>
Valora esta pregunta


0