Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2009, 00:47
dhariuz
 
Fecha de Ingreso: noviembre-2009
Mensajes: 35
Antigüedad: 14 años, 5 meses
Puntos: 0
Exclamación error en php Warning: "Cannot modify header information - headers already sent by "

en la escuela nos pusieron a que corrigieramos un sistema de usuarios la mayor parte pude hacerlo solo que al iniciar sesion que te da privilegios por niveles me pone este error
Código PHP:
WarningCannot modify header information headers already sent by (output started at C:AppServwwwquantumprocesaingresar.php:13in C:AppServwwwquantumprocesaingresar.php on line 16 
tengo este codigo para iniciar la sesion
ingresar.php
Código PHP:
<html>
<
body>
      <
table align="center">
           <
form name="ingresar" method="post" action="procesaIngresar.php" onSubmit="return validar();">
                 <
tr>
                     <
td align="center" colspan="2"><font color="orange"><h2>Identificate</h2></font></td>
                 </
tr>
                 <
tr>
                     <
td>Usuario:</td><td><input type='text' name='usuario' size=15></td>
                 </
tr>
                 <
tr>
                     <
td>Clave:</td><td><input type='password' name='password' size=15></td>
                 </
tr>
                 <
tr>
                     <
td align="center" colspan="2"><br><input type='submit' value='Ingresar'></td>
                 </
tr>
                 <
script language="javascript">
                         function 
validar(){
                                var 
usuario=document.ingresar.user.value;
                                var 
password=document.ingresar.pass.value;
                                if(
usuario==''){alert("Introduce el campo usuario");return false;}
                                if(
password==''){alert("Introduce el campo clave");return false;}
                                return 
true;
                         }
                 
</script>
            </form>
      </table>
</body>
</html> 
y el siguiente es el codigo que lo procesa
procesaingresar.php
Código PHP:
<?
session_start
();

  if (isset(
$_POST["usuario"]) && isset($_POST["password"])){

     include 
"conexion.php";

     
$sql="SELECT * FROM usuarios WHERE usuario='".$_POST["usuario"]."' AND password='".$_POST["password"]."'";
     
$resultado=mysql_query($sql,$conexion);

     if (
mysql_affected_rows()>0){
         
$registro=mysql_fetch_array($resultado);
         echo
"El usuario $registro[1] fue encontrado";
         
$_SESSION["nombre"]=$registro[1];
         
$_SESSION["nivel"]=$registro[4];
         
header("Location:/menu.php");
     }
     else{
          echo 
"<center><font color=orange><h2>No se puede ingresar, verifica el usuario y/o password</h2></font>
                <br><br><a href=ingresar.php>Inicio</a></center>"
;
                 }
  }
?>
pues esa es mi duda espero que me puedan ayudar