Hi Kerin.
Try it so.
function startsession($username,$pswd){
if(!$PHPSESSID){
//start session
session_start();
$sess_name = $username;
session_register("sess_name");
$sess_pswd = $pswd;
session_register("sess_pswd");
$userauth = 1;
session_register("userauth");
}
}
kerin wrote:
Hi all,
I'm taking my first foray into using sessions in PHP4 and I'm having more than a few problems.
I'm using this function to start the session and register 3 variables :
function startsession($username,$pswd){
if(!$PHPSESSID){
//start session
session_start();
session_register("sess_name");
$sess_name = $username;
session_register("sess_pswd");
$sess_pswd = $pswd;
session_register("userauth");
$userauth = 1;
}
}
if I call the function then echo("") the 3 variables straight back out, I get nothing - it seems the session variables arent being set.
But, if I echo the variables within the function, they work. what am i doing wrong?
all the documentation I've found just tells me that I have to register the session variables then assign them a value. But I cant seem to retrieve the variable afterwards. What am I doing wrong?
The PHPSESSID cooki....