Re: Sessions?

From: Date: Sat, 14 Apr 2001 06:26:59 +0000
Subject: Re: Sessions?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48514@lists.php.net to get a copy of this message
The way I do it is to stick all those global variables into an include file, which I usually named something like global.php. Just do that and require() the file at the top of all your scripts which need it. Keep things like page color, text color, font, etc in the global file. If you ever need to change the color before you use them, just alter the colors at the top of your scripts after the require(), but before you "do" anything with them (such as echo them to the browser). Once you have the site working like that, it's easy to add per-user customization. So in the future you just check to see if a session variable is set, and if it is you replace the global variable value with the session variable value. -- Plutarck Should be working on something... ...but forgot what it was. ""Ashley M. Kirchner"" <ashley@pcraft.com> wrote in message news:3AD7709B.5B4EF1EA@pcraft.com... > > I'm used to building pages that contain links that have variables > passed on the URL (somepage.php?var1=1&var2=2...) and I'm now looking > into building a site that will have quite a bit of these that will have > to 'live' from page to page, occasionally getting reset, or changed by > new page. I'm told sessions are the way to go (specially since this > will have several users using the site). > > And consequently, now I'm lost. Sessions..okay..how does the > variable 'live' from one to the other? What do I have to do different > when setting variables that will be used globally across the site (and > reset/changed from time to time)? I don't need to STORE any of these > (say for a future log-in), however if it's easy (easier?) to do it that > way, that's fine as well. I may eventually start making the site > customizable on a per user basis. But for right now, I need a startup > primer first. > > AMK4 > > -- > W | > | I haven't lost my mind; it's backed up on tape somewhere. > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:ashley@pcraft.com> . > 303.442.6410 x130 > SysAdmin / Websmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 > Arapahoe Ave #6 > .................. . . . . Boulder, CO 80303, USA > > > > -- > 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 (#48514) next »