Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/09/2012, 20:33
ANDRESDD
 
Fecha de Ingreso: julio-2012
Ubicación: Guatemala
Mensajes: 99
Antigüedad: 11 años, 9 meses
Puntos: 2
Pregunta problemas al enviar datos

buenas noches a todos, estoy teniendo problemas a la hora de subir mi pagina, en mi pc todo funciona bien, pero cuando la subo a la red e ingreso mis datos para loguearme como usuario me salen estos errores:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in... on line 30

Warning: Cannot modify header information - headers already sent by (output started at... on line 42

este es el codigo:

<?php
require_once("conexion2.php");
if (isset($_POST['ecorreo']) && isset($_POST['clave']))
{
$sega = sprintf ("select ".$EMA.", ".$CLA.", ".$NOM.", ".$EST." from ".$US." where ".$EMA."='%s' ", mysql_real_escape_string($_POST['ecorreo'] ) ); //ESTA ES LA LINEA 30
$registro=mysql_query($sega);
$reg=mysql_fetch_array($registro);
//echo $reg["$NOM"];
//echo $reg["$CLA"];
$_POST['clave'] =sha1($_POST['clave']);
if (($_POST['ecorreo']==$reg["$EMA"])&&($_POST['clave']==$reg["$CLA"]) && ($reg["$EST"]=='1'))
{
session_start();
$_SESSION['usuario']=$reg["$NOM"];
$_SESSION['tiempo']=time();
header("location:arenare.php");
}//ESTA ES LA LINEA 42
else
header("location:arenare.php");
}
else
{
?>
<div align="right">
<form action="index.php" method="POST">
<font color="#ffffff">Correo: </font><input type="text" name="ecorreo" size="25" maxlenght="25"/>
<font color="#ffffff">Clave: </font><input type="password" name="clave" size="20" maxlenght="25"/>
<input type="submit" value="Entrar"/>
</form>
<a href="recuperar.php"><font color="#ff0000" size="2"> &iquest;Olvidaste tu contraseña?</font></a>
</div>
<?php
}
?>

He estado moviendo de lugar el sessionstart(); poniendolo hasta arriba despues de <?php pero solo consigo otro error:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at... on line 25

no se que me causa estos errores ya que en mi pc de manera local todo funciona al 100%, espero contar con su ayuda gracias!