Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/02/2008, 05:09
Avatar de syntex
syntex
 
Fecha de Ingreso: noviembre-2002
Ubicación: Cataluña
Mensajes: 978
Antigüedad: 22 años, 4 meses
Puntos: 4
Problemas con sesion

Hola buenas,

Tengo una duda que no me salgo tengo en la página index.php esto


INDEX.PHP
Código PHP:
// ACEPTAR GESION DE ANUNCIOS
if (trim($_POST[hn]) !="" and trim($_POST[hn1]) !=""){
        
$conexion mysql_connect("localhost","aaaaaaaaaaaaa","000000000");
        include(
"./Estandar/mysql_select_db.php");
        
$R1 mysql_query("SELECT * FROM venta WHERE (Usuario = '".trim(strtolower($_POST[hn]))."' and Password ='".trim(strtolower($_POST[hn1]))."' and Activado = 'Si' and Cerrado != 'Si')",$conexion);
        
$Rn1 mysql_num_rows($R1);
        if (
$Rn1 != 0){
        include(
"../sesiones.php");
        
exit;}
        if (
$Rn1 == 0){$FATAL "Datos no correctos. Específica bien tu cuenta.";}
        
mysql_free_result($R1);
        
mysql_close($conexion);


SESIONES.PHP

Código PHP:
<? 
if ($_GET['Ce'] != "Ok"){
    
session_set_cookie_params (600,"/","miportal.es"0);
    
session_name('Ses_id');
    
session_start();
    
session_register("autentificado"); 
        if (
$_POST[hn] !=""){$_SESSION['user'] = md5(strtolower(trim($_POST[hn])));$_SESSION['SU'] = $CUCA;$_SESSION['SI'] = $CUCA1;$_SESSION['cpl']=120;}
    if (
$_SESSION[user] !="" and $_SESSION[SU] !="" and session_id() !=""){
    
header ("Location: ../G_Anuncios/index.php?a=5&user=".$_SESSION['user']."&SU=".$_SESSION['SU']."&SI=".$_SESSION['SI']."&".session_name()."=".session_id()); 

    exit;
    }
}
?>
G_Anuncios/index.php

Porque en la nueva página redireccionada G_Anuncios.php no tengo la variable de la session user?

<?
echo $_SESSION[user];
?>
__________________
------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------