Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/02/2011, 15:01
Antonioj1015
 
Fecha de Ingreso: agosto-2009
Mensajes: 30
Antigüedad: 14 años, 8 meses
Puntos: 0
Pregunta Header error PHP

Cita:
Warning: Cannot modify header information - headers already sent by (output started at /home/validar.php:10) in /home/validar.php on line 51
me sale este error pero solo en el servidor cuando lo ejecuto local, wamp, me funciona bien aqui esta el codigo:
Código PHP:
<?php
session_start
();
?>
<!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>Constructora Los Mayales - Validacion</title>
<link href="css/estilo_panel.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
    background-color: #FFF;
}
</style>
</head>

<body>
<div class="container">
  <div class="header">
    <center>
      <img src="img/logo.png" width="156" height="111" /><br />
</center>
  </div>
  <div class="content">
<?php
if ($_REQUEST['login']!="" and $_REQUEST['clave']!="")
{
require(
'conectarse.php');
$link=conectarse();

$myusername=$_POST['login'];
$mypassword=$_POST['clave'];

$myusername stripslashes($myusername);
$mypassword stripslashes($mypassword);
$myusername mysql_real_escape_string($myusername);
$mypassword mysql_real_escape_string($mypassword);

$tabla "usuarios";
$encrypt_clave=md5($mypassword);
$consulta "select tipo from $tabla where idusuario='$myusername' and clave='$encrypt_clave'";
$resultado=mysql_query($consulta);
$numregistros=mysql_num_rows($resultado);
     if(
$numregistros!=0)
    {
        
$_REQUEST['tipo']=mysql_result($resultado,$i);
        if (
$_REQUEST['tipo']=='1')
        {
            
$_SESSION['autentificado']= "SI";
            
$_SESSION['tipo']= "1";
            
header('location: menuadmin.php');
            exit();
        }
        else
        {
            
$_SESSION['autentificado']= "SI";
            
$_SESSION['tipo']= "0";
            
header('location: comentario.php');
            exit();
        }
    }
    else
    {
        echo 
"Login o password incorrectos.";
        
header('refresh:1;url=index.php');
        exit();
    }
}
else
   {
        echo 
"Login o password incorrectos.";
        
header('refresh:1;url=index.php');
        exit();
    }
    
session_write_close();
 
?>
  <!-- end .content --></div>
  <div class="footer">
    
    <!-- end .footer --></div>
  <!-- end .container --></div>
</body>
</html>