Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/10/2005, 22:57
blackrocha
 
Fecha de Ingreso: noviembre-2004
Mensajes: 181
Antigüedad: 19 años, 5 meses
Puntos: 1
problema con el header

hola amigos del foro otra ayudita
saben tengo un problemita con esto q es el haiden ya que me marca un error
aqui esta el codigo y luego les doy el error y le marco donde esta el eroor en q linea,


<?php
session_start();
echo "<html>\n";
echo "<head>\n";
echo "<title>Inicio de sesion</title>\n";
echo "</head>\n";

echo "<body bgcolor='#003399' text='#00FF99'>\n";

if(isset($btningresar))
{
$enlace = mysql_connect("localhost", "root", "") or die("No pudo conectarse : " . mysql_error());
mysql_select_db("hospital") or die("No pudo seleccionarse la BD.");

$consulta="SELECT usuario.login,usuario.pas FROM usuario where LOGIN='$txtlogin' and PAS='$txtpassword'";
$res=mysql_query($consulta) or die("La consulta fall&oacute;: " . mysql_error());
mysql_close();
$num=mysql_numrows($res);

if ($num)
{
echo "<center>DATOS INGRESADOS CORRECTAMENTE</center><br>";
session_register('LOGIN');
$LOGIN=$txtlogin;
header("Location:menu.php");
}
else
{
echo "<center><h3><b>INGRESE SUS DATOS CORRECTAMENTE<b><h3></center>";
echo "<a href='$PHP_SELF'><center>ATRAS</center></a>";
}

}

else
{
echo "<center><h2><b>Mi Inicio2</b></h2></center><br><br>\n";

echo "<form action='$_SERVER' method='post'>\n";

echo "<center>\n";
echo "<table border='1' width='100' height='74'>\n";
echo " <tr> \n";
echo " <td width='50%' height='19'><strong><font face='Verdana'>Login</font></strong></td>\n";
echo " <td width='50%' height='19'><input name='txtlogin' type='text' size='15' maxlength='10'></td>\n";
echo " </tr>\n";

echo " <tr> \n";
echo " <td width='50%' height='18'><strong><font face='Verdana'>Password</font></strong></td>\n";
echo " <td width='50%' height='18'><input name='txtpassword' type='password' size='15' maxlength='10'></td>\n";
echo " </tr>\n";

echo "<tr> \n";
echo " <td><center><a href='inicio2.php'><img src='../general/imagen/mano.gif' border='o'></a></td></center>\n";
echo " <td><input type='submit' value='Ingresar' name='btningresar'></td>\n";
echo "</tr>\n";

echo "</table>\n";
echo "</center>\n";

echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
}
?>


y el error que me arroja es el siguiente
Warning: Cannot add header information - headers already sent by (output started at C:\apache\htdocs\mi_sistema\index.php:3) in C:\apache\htdocs\mi_sistema\index.php on line 25