Ver Mensaje Individual
  #10 (permalink)  
Antiguo 27/07/2007, 20:13
santuguerra
 
Fecha de Ingreso: julio-2007
Mensajes: 71
Antigüedad: 16 años, 10 meses
Puntos: 1
Re: no puedo rescatar variables SESSION

usa session_start(); al PRINCIPIO de todo...

Código PHP:
<?php
                
// Inicializamos sesion aca <----------------------------------------
                
session_start();
$usuario $_POST["txt_usuario"];
$clave $_POST["txt_clave"];
// Busca en BD el usuario ingresado
        
$sql "SELECT * ";
        
$sql.= "FROM gschool.usuario WHERE usu_rut='".$usuario."'";
        
$rs_datos select_data($sql, &$f_est, &$c_est);
        
$ls_datos mysql_fetch_array($rs_datos);
        if (
$f_est 0){
            if (
strtolower($ls_datos["usu_clave"]) == strtolower($clave)){
                
$login $ls_datos["usu_rut"];
                
$perfil $ls_datos["usu_perfil"];
                
$autentificado 1;
                
//Aca saque la "session_start()"
                
$_SESSION['autentificado'] = $autentificado;
                
$_SESSION['login'] = $login;
                
$_SESSION['perfil'] = $perfil;
                if(
$perfil==1){
                    
header("Location:".$gserver."php/admin/home.php");
                }
                if(
$perfil==2){
                    
header("Location:".$gserver."php/profesores/home.php");
                }
                if(
$perfil==3){
                    
header("Location:".$gserver."php/alumnos/home.php");
                }
                if(
$perfil==4){
                    
header("Location:".$gserver."php/apoderados/home.php");
                }
            }else{
                
header("Location:".$gserver."index.php?err=2");
                exit;
                    }
        }else{
        
header("Location:".$gserver."index.php?err=1");
            exit;
            }
        
mysql_free_result($rs_datos);
?>
Fijate si te anda y me comentas!