Ver Mensaje Individual
  #7 (permalink)  
Antiguo 23/06/2005, 16:39
al3jo
 
Fecha de Ingreso: junio-2004
Mensajes: 60
Antigüedad: 19 años, 11 meses
Puntos: 1
Es sencillo: No debes mezclar $_SESSION con session_register.

de: http://ar.php.net/session_register
Caution

If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister().

////////////

<? //controla.php
session_start();
if ($_SESSION["logueo"]!="SI"){
header ("Location: prueba.php");
exit();
}
?>

en cada pagina colocas:

<?
require("controla.php");
?>

<html>
<head></head>
<body>
aca va tu pagina
</body>
</html>

Y no te olvides de colocar donde consultas la db y verificas q el usuario existe:
<?
session_start();
$_SESSION["logueo"]= "SI";
$_SESSION["who_is"]= $_POST["nombre"];
header("Location:tu_pagina_qde inicio_login.php");
exit();
?>

Y cuando haces el logout. elimina todas las variables asi.
<?
session_unset();
session_destroy();
?>