14/11/2007, 06:15
|
| | Fecha de Ingreso: noviembre-2007
Mensajes: 30
Antigüedad: 17 años Puntos: 0 | |
Re: Warning: session_start() [function.session-start]: Cannot send session cookie - h Hola Amigos: Me surge este problema necesito saber como lo soluciono, puede ser que las register_globals estén en off? sino no se que puede ser. Envío el archivo que me da el error. Gracias
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/localhost/htdocs/servicio/conexion.php:9) in /var/www/localhost/htdocs/servicio/validar.php on line 14
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/servicio/conexion.php:9) in /var/www/localhost/htdocs/servicio/validar.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/servicio/conexion.php:9) in /var/www/localhost/htdocs/servicio/validar.php on line 24
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
<?php include("conexion.php");
$nick=$_POST["user"];
$pass=$_POST["pass"];
$pass=md5($pass);
$query="SELECT * FROM usuario WHERE";
$query.=" (user='$nick' and pass='$pass')";
$result = mysql_db_query($dbname,$query);
//si no devuelve coincidencias entonces vuelvo al login.
if (mysql_num_rows($result))
{
while($fila = mysql_fetch_array($result))
{
session_name("loginUsuario");
session_start();
$id=$fila["id"];
$nombre=$fila["nombre"];
$apellido=$fila["apellido"];
$user=$fila["user"];
$pass=$fila["pass"];
$rol=$fila["rol"];
$_SESSION["validado"]="SI";
$_SESSION["ultimoAcceso"]= date("Y-n-j H:i:s");
session_register("id","nombre","apellido","user"," pass","rol");
header("Location: menu.php ");
}
mysql_free_result($result);
}
else
{
header("Location: incorrecto.php");
}
?> |