Sessions + includes

From: Date: Thu, 19 Jul 2001 11:59:16 +0000
Subject: Sessions + includes
Groups: php.general 
Request: Send a blank email to php-general+get-58671@lists.php.net to get a copy of this message
Hi Sorry for my bad english ;-) I'm writing an application using php and sessions. In the first include file i'm writing something like this session_start(); session_register(loggedin); The i have another include file with the functions. When i'm submitting the username and passwort to the function which checks them i'd like to set loggedin to 1 how does this work? function CheckLogin($username,$password) { if($username=='test' && $password=='user') { $loggedin=1; header("location:secretpage.php"); } else { $loggedin =0; header("location:login.php") } Can i user include with sessions or doe i have to use requiere? I also tried to set the $loggedin to 1 this way: $HTTP_SESSION_VARS[loggedin]=1; This doesn't work too. Please help me THX

« previous php.general (#58671) next »