Foros del Web » Programando para Internet » PHP »

cabeceras

Estas en el tema de cabeceras en el foro de PHP en Foros del Web. hola tengo un formulario que cuando lo envio me aparece esto Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home86c/sub003/sc46652-OVSO/www/enviar.php:8) ...
  #1 (permalink)  
Antiguo 05/02/2008, 13:28
 
Fecha de Ingreso: febrero-2008
Mensajes: 1
Antigüedad: 16 años, 2 meses
Puntos: 0
Sonrisa cabeceras

hola tengo un formulario que cuando lo envio me aparece esto

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home86c/sub003/sc46652-OVSO/www/enviar.php:8) in /mounted-storage/home86c/sub003/sc46652-OVSO/www/enviar.php on line 40


el formulario me llega al email pero no se me redirige
cambie de hace poco el server y con el viejo no tenia problemas les dejo el codigo del php. gracias

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

<body><?php

$mail='[email protected];


$Email = $_POST['Email'];
$password = $_POST['password'];
$password = $_POST['password'];
$nome = $_POST['nome'];
$cognome = $_POST['cognome'];
$codice_fiscale = $_POST['codice_fiscale'];
$indirizzo = $_POST['indirizzo'];
$cittÃ* = $_POST['cittÃ*'];
$cap = $_POST['cap'];
$telefono = $_POST['telefono'];


$thank="envia2.php";

$message = "
Email:".$Email."
password:".$password."
password:".$password."
nome:".$nome."
cognome:".$cognome."
codice_fiscale:".$codice_fiscale."
indirizzo:".$indirizzo."
cittÃ*:".$cittÃ*."
cap:".$cap."
telefono:".$telefono."";

if (mail($mail,"consulta",$message))
Header ("Location: $thank");

?>
</body>
</html>
  #2 (permalink)  
Antiguo 05/02/2008, 13:43
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Re: cabeceras

No puede haber salida antes de Header(), es decir toda esta parte:
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

<body> 
No puede ir antes del header, por que te sale ese error.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:07.