RE: [PHP] make a set of variables available to all visitors?

From: Date: Mon, 15 Apr 2002 05:16:42 +0000
Subject: RE: [PHP] make a set of variables available to all visitors?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-92963@lists.php.net to get a copy of this message
Actually the static variables will be used to make the query. ie I want these static variables to be used so that my url can be transformed into a numeric reference for the db query > website.com/finance/ "finance" gets parsed out of URL to be used in where condition > $article_type = array("news" => 1,"opinion" => 2,"finance" => 3); $sql = "SELECT * FROM articles WHERE article_type = '2'"; /* where condition will contain other criteria as well (date/region) */ olinux --- Cal Evans <cal@calevans.com> wrote: > Actually, if they are static variables that rarely > or never change, I would > stick with the include file. It's faster than > making a database connection > and selecting them. > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -----Original Message----- > From: olinux [mailto:olnx@yahoo.com] > Sent: Sunday, April 14, 2002 11:40 AM > To: php-general@lists.php.net > Subject: [PHP] make a set of variables available to > all visitors? > > > What would be the best way to make a set of > variables > available to all visitors? > > example: > if I stick all variables in a separate file and > include - include(settings.php); - that works fine. > seems that this is a lot of overhead to include > these > on every page. These variables would never change > (they basically turn an alpha string into numeric to > speed up queries.) I don't think hard coding would > be > a great solution either... > > simplified example: > one set of variables to be included on all pages > refer > to the article type - i would like to use urls that > make sense to the visitor rather than number strings > so - > $article_type = array("news" => 1,"opinion" => > 2,"finance" => 3); > > Maybe it would be best to simply query for WHERE > article_type = 'news' etc. > > Thanks much, > olinux > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/

« previous php.general (#92963) next »