PHP - Es por la versión? AYUDDA

 
Vista:

Es por la versión? AYUDDA

Publicado por guzmi (2 intervenciones) el 28/07/2008 22:34:09
hola, tengo una web programada en php y la tengo instalada en un servidor con php 5.2.5 y los usuarios se puede loguera perfectamente pero la paso a un servidor con php 5.2.6 y me al intentar loguearse me lanza este error:

Warning: Cannot modify header information - headers already sent by (output started at D:AppServwwwestrenoslogin.php:148) in D:AppServwwwestrenoslogin.php on line 178

Warning: Cannot modify header information - headers already sent by (output started at D:AppServwwwestrenoslogin.php:148) in D:AppServwwwestrenoslogin.php on line 180

Warning: Cannot modify header information - headers already sent by (output started at D:AppServwwwestrenoslogin.php:148) in D:AppServwwwestrenoslogin.php on line 182

Debajo os dejo el codigo del login.php

<?

if($_GET[iniciar] == "sesion") {

?>

<table width="360" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="3%"><img src="imagenes/web/tabla/tabla1.gif" width="31" height="41" /></td>

<td width="92%" background="imagenes/web/tabla/tabla2.gif"><font color="#666666"><strong>Iniciar sesión</strong></font></td>

<td width="5%"><img src="imagenes/web/tabla/tabla3.gif" width="22" height="41" /></td>

</tr>

</table>

<table width="359" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="2%" background="imagenes/web/tabla/tabla5.gif"><img src="imagenes/web/tabla/tabla5.gif" width="12" height="29" /></td>

<td width="97%" bgcolor="#E3E3E3"><div align="center">

<table width="335" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="294"><div align="center">

<table width="324" border="0" align="center" cellpadding="4" cellspacing="2">

<tr>

<td width="312"><font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <strong><font color="#EEEEEE">

<form action="login.php" method="post" name="form1" id="form1">

<table width="100%" border="0" cellspacing="3" cellpadding="3">

<tr>

<td colspan="2"><div align="center"><font color="#666666">Para iniciar sesión

primero deberás tener una cuenta, si no la tienes

créatela haciendo click aquí totalmente gratis.

Si yá tienes una introduce tus datos</font></div></td>

</tr>

<tr>

<td width="49%"><font color="#CCCCCC"><strong><font color="#FFCC00" face="Tahoma">+</font> <font color="#666666">Usuario: </font></strong></font></td>

<td width="51%"><strong>

<input name="user" type="text" id="user" size="20" class="formu" />

</strong></td>

</tr>

<tr>

<td><font color="#CCCCCC"><strong><font color="#FFCC00" face="Tahoma">+</font> <font color="#666666">Contraseña: </font></strong></font></td>

<td><strong>

<input name="pass" type="text" id="pass" size="20" class="formu" />

</strong></td>

</tr>

<tr>

<td colspan="2"><div align="center">

<input name="login" type="submit" id="login3" value="Iniciar sesión" class="formu" />

</div></td>

</tr>

</table>

</p>

</form>

</font></strong></font></td>

</tr>

<tr> </tr>

</table>

</div> </td>

</tr>

</table>

</div></td>

<td width="1%" background="imagenes/web/tabla/tabla4.gif"><img src="imagenes/web/tabla/tabla4.gif" width="14" height="29" /></td>

</tr>

</table>

<table width="361" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="3%"><img src="imagenes/web/tabla/tabla7.gif" width="12" height="17" /></td>

<td width="96%" background="imagenes/web/tabla/tabla8.gif"> </td>

<td width="1%"><img src="imagenes/web/tabla/tabla6.gif" width="14" height="17" /></td>

</tr>

</table></td>

</tr>

</table>

<?

//

}else {

?>

<?

if($_POST[login]) {

if($_POST[user] && $_POST[pass]) {

include("config.php");

$contrasena = md5($_POST[pass]);

$comprobaridentidad = mysql_query("select * from usuarios where nick='$_POST[user]'");

if(mysql_num_rows($comprobaridentidad) == 0) {

header("location: iniciarsesion.html");

}

else {

$datosu = mysql_fetch_array($comprobaridentidad);

if($datosu[contrasena] != $contrasena) {

header("location: iniciarsesion.html");

}

else {

setcookie("usuario_nick",$_POST[user],time()+7776000) ;

setcookie("usuario_pass",$contrasena,time()+777600 0) ;

header("location: index.php");

}

}

}

else {

header("location: iniciarsesion.html");

}

//

}

else {

?>

<?

}

}

?>


GRacias de antemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Es por la versión? AYUDDA

Publicado por Diego Romero (1450 intervenciones) el 29/07/2008 06:44:36
El mensaje de error (en realidad es un aviso) aparece cuando intentas enviar un header después de haber enviado algo al cliente, aunque ese algo sea un simple espacio en blanco o un retorno de carro. Te sugiero que revises cuidadosamente dónde dejas espacios en blanco o líneas vacías en tu código fuente que podrían "escaparse" al clientes antes de ejecutarse un header.

Aquí no puedo revisar tal cosa con el código que has posteado.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar