Problema con header
Publicado por Albert Delgado (11 intervenciones) el 23/03/2005 20:43:05
Hola,
Tengo el siguiente codigo:
<html>
<head><title>Web procesante</title>
</head>
<body>
<?php
if(empty($_POST['name'])){
$error.=urlencode("Te falta por introducir el nombre");
}
if(empty($_POST['Greeting'])){
$error.=urlencode("Te falta por introducir el apellido");
}
if(empty($error)){
?>
<table border="0" cellspacing="1" cellpadding="3" bgcolor="353535" align="center">
<tr>
<td bgcolor="#ffffff" colspan="2" align="center">
<?php echo $_POST['Greeting']?>
</td>
</tr>
<td bgcolor="#ffffff" colspan="2" align="center">
<?php echo $_POST['Name']?>
<?php
}else{
header("location:http://localhost/form2.php?error=".$error);
}
?>
</body>
</html>
Y me da problema con lla funcion header, el aviso k me sale es el siguiente:
Warning: Cannot modify header information - headers already sent by (output started at C:\Archivos de programa\Apache Group\Apache2\test\formprocess2.php:5) in C:\Archivos de programa\Apache Group\Apache2\test\formprocess2.php on line 24
Alguien se le ocurre k puede pasar?
Tengo el siguiente codigo:
<html>
<head><title>Web procesante</title>
</head>
<body>
<?php
if(empty($_POST['name'])){
$error.=urlencode("Te falta por introducir el nombre");
}
if(empty($_POST['Greeting'])){
$error.=urlencode("Te falta por introducir el apellido");
}
if(empty($error)){
?>
<table border="0" cellspacing="1" cellpadding="3" bgcolor="353535" align="center">
<tr>
<td bgcolor="#ffffff" colspan="2" align="center">
<?php echo $_POST['Greeting']?>
</td>
</tr>
<td bgcolor="#ffffff" colspan="2" align="center">
<?php echo $_POST['Name']?>
<?php
}else{
header("location:http://localhost/form2.php?error=".$error);
}
?>
</body>
</html>
Y me da problema con lla funcion header, el aviso k me sale es el siguiente:
Warning: Cannot modify header information - headers already sent by (output started at C:\Archivos de programa\Apache Group\Apache2\test\formprocess2.php:5) in C:\Archivos de programa\Apache Group\Apache2\test\formprocess2.php on line 24
Alguien se le ocurre k puede pasar?
Valora esta pregunta


0