Warning: Cannot modify header information - headers already sent by (output started at /users/alumni/a/al020472/www/Buscador web/index.php:2)
| From: | Adrian Ferreres Esteller | Date: | Mon, 09 May 2005 10:24:52 +0000 |
| Subject: | Warning: Cannot modify header information - headers already sent by (output started at /users/alumni/a/al020472/www/Buscador web/index.php:2) | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-54667@lists.php.net to get a copy of this message | ||
Hola lista:
¿Podeis hecharme una mano con las practicas de cliente- servidor? La idea es
crear un buscador web minimamente decente. Ahora toca programar la interfaz del
buscador en php y los profes me han pedido que, mediante coockies el buscador se
acuerda de la ultima busqueda realizada por el usuario, es decir, que si el
usuario pulsa el buton de marcha atras del navegador le salga en el cuadro de
texto de la busqueda su ultima busqueda. El codigo de la interfaz del buscador
es el siguiente:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
if (!isset ($busqueda))
{
setcookie ("busqueda","",time()+3600);
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Buscador IP WEB</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0"
cellpadding="4">
<tr>
<td align="center"> <font color="#99FF99"><img
src="mm/stationery/_V_Master/titulo copiar.jpg" alt="IP WEB"
name="image"
width="780" height="80"/>
</font></td>
</tr>
</table>
<p> </p>
<form action="resultado.php" method="post">
<label for="clave_busqueda" accesskey="b">
<table width="633" border="1" align="center">
<tr>
<th width="133" rowspan="2" align="center"
valign="top"><input type="image"
src="Lupa.gif" width="131" height="131" alt="Boton
Lupa"/></th>
<td width="310" height="41" align="center"
bgcolor="#CCFFFF">
<h3><font face="Comic Sans MS">Da una orden al
detective</font></h3></td>
<td width="168" rowspan="2"><strong><font face="Comic
Sans MS">Pulsa sobre
la lupa para que el detective inicie su busqueda.</font></strong></td>
</tr>
<tr>
<?php
if ($busqueda=="")
{
echo "<td><input name='clave_busqueda' id='clave_busqueda'
type='text'
size='50'/></td>";
}
else
{
echo "<td><input name='clave_busqueda' id='clave_busqueda'
type='text'
size='50' value='".$busqueda."'/>";
}
?>
</tr>
</table>
</label>
</form>
<p> </p>
<a
href="http://validator.w3.org/check?uri=www4.uji.es/~al020472/Buscador%20web/index.htm"><img
src="imagenes/valid-xhtml10.png" alt="Validacion en XHTML"/></a>
</body></html>
Y cuando lo ejecuto me da el siguiente error:
Warning: Cannot modify header information - headers already sent by (output
started at /users/alumni/a/al020472/www/Buscador web/index.php:2)
¿Alguien me puede dar una pista de como solucionarlo?
Muchas Gracias