RE: [PHP] make a set of variables available to all visitors?
| From: | Cal Evans | Date: | Sun, 14 Apr 2002 17:08:47 +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-92926@lists.php.net to get a copy of this message | ||
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