|
-
Ex-***
Session_register problem
For some reason this code does not work as intended:
PHP Code:
$kundetype = htmlspecialchars( stripslashes($row['btype']));
$b_id = htmlspecialchars( stripslashes($row['brukerid']));
if ($num_results > 0) {
session_register("innlogget", "tilgang", "sessbrukerid");
$innlogget = $navn;
$tilgang = $kundetype;
$sessbrukerid = $b_id;
}
The $innlogget and $tilgang variables are set with the right value, but somehow $sessbrukerid is set the same value as $tilgang ($kundetype).
Why does this happen? I've made sure to deregister all session variables one by one and destroy the session upon logout, but it still happens the next time I log in.
Last edited by kid A; 08-01-2003 at 08:31 AM.
Now listening to various rock and metal
143rd member to join Sharkyforums.
-
Ursus Arctos Moderatis
Do your assignments first:
PHP Code:
$innlogget = $navn;
$tilgang = $kundetype;
$sessbrukerid = $b_id;
...and then register them in session.
PHP Code:
session_register("innlogget", "tilgang", "sessbrukerid");
-
Ex-***
Now listening to various rock and metal
143rd member to join Sharkyforums.
-
Ex-***
Ah, seems it was a problem with the values retrieved from the database, rather than with the session itself. Doh!
Now listening to various rock and metal
143rd member to join Sharkyforums.
-
Ursus Arctos Moderatis
It's been a long week hasn't it?
-
Ex-***
Certainly has
I kept going till 6 AM last night and was back in action at noon...
Now listening to various rock and metal
143rd member to join Sharkyforums.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|