Re: Sessions?

From: Date: Sat, 14 Apr 2001 13:55:20 +0000
Subject: Re: Sessions?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-48542@lists.php.net to get a copy of this message
Ahh. I reread your post and now I see what you were originally asking. Yes, sessions are the best way to handle it then. The variables "live" by sending a specially augmented header to the client. The header sort of "sticks" to the client so that their session ID is automatically sent in their requests for new pages. It's basically a cookie that isn't stored on the persons hard drive. There are instances where a person's browser is, for lack of a better word, "teflon coated" so that the header/cookie just doesn't "stick" to them. That's when PHP appends the "PHPSESSID=[long string of characters]" to all of your links. So the short answer to your question is "Yes, it's the best way to handle it". But it must be noted that when someone submits a variable through the URL it will _not_ change the value of any session variables. You must do that explicitly in your code. -- Plutarck Should be working on something... ...but forgot what it was. ""Ashley M. Kirchner"" <ashley@pcraft.com> wrote in message news:3AD81D6B.A070E6@pcraft.com... > Plutarck wrote: > > > The way I do it is to stick all those global variables into an include file, > > which I usually named something like global.php. > > Um no. These aren't static variables. They change from page to > page. For example, page one > > $foo=0, $bar=3, $baz='Closed' > > They follow a particular link that changes them to, > > $foo=1, $bar=3, $baz='Open' > > They follow yet another link, and this time only $bar changes, > > $foo=1, $bar=2, $baz='Open' > > Right now, the way I've always done that was to include it in the > URL: next_page.php?foo=0$bar=3&baz='Closed' - they follow a link, and > those variables get tacked again. If it's a form, I pass hidden input > tags. > > But, there's got to be a better, transparent way of doing this. No? > > AMK4 > > -- > H | Hi, I'm currently out of my mind. Please leave a message. BEEEEP! > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:ashley@pcraft.com> . > 303.442.6410 x130 > Director of Internet Operations / SysAdmin . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe > Ave, #6 > .................. . . . . Boulder, CO 80303, U.S.A. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#48542) next »