Re: Problem grabbing value of session
| From: | Erik Price | Date: | Tue, 16 Apr 2002 18:42:01 +0000 |
| Subject: | Re: Problem grabbing value of session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93236@lists.php.net to get a copy of this message | ||
On Tuesday, April 16, 2002, at 02:40 PM, Jeff Lewis wrote:
Right after I call those I try a is_registered and it showed that these registered correctly. I removed that code and added a call to another function: redirectinternal();You can avoid the whole "session_register()" business if you simply refer to these variables as $_SESSION['valid_user'] and $_SESSION['privs'] -- after all, that's what they are, simply session variables. By using this convention, you clarify exactly what kind of variables they are each time you write them, which is good for legibility later in the future. Also, you don't need to declare them as global in your redirectinternal() function, since any $_* variable is considered global at all times.
That function is below: function redirectinternal () { global $valid_user,$privs; echo "Login good!"; echo "<BR>".$valid_user." - ".$privs.$temp; } Now, I can't seem to get those values to print to the screen. I added a session_start before the echo and I just can't get my values out...what am I missing?You'll have to post the context of this function (how it is called in the script) for an answer to this question. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com