Re: Creating a global variable for all PHP pages?
| From: | David Robley | Date: | Fri, 22 Feb 2002 01:31:24 +0000 |
| Subject: | Re: Creating a global variable for all PHP pages? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85799@lists.php.net to get a copy of this message | ||
In article <00ae01c1bb10$dc440280$16000064@fredsystems.com>,
wwilson@fredsystems.com says...
> I want to define a variable that I can reference on ALL of my PHP pages.
> Ideally, I'd like to do it in php.ini or some similar place so that I can
> modify it as I place code on different systems, but not need to make changes
> in lots of different places.
>
> I looked at the Configuration section of the manual, did web searches, tried
> getenv() and using the OS environment (we're mixed Windows and UNIX boxes,
> using Apache and mysql and PHP 4.1.1), and had zero luck. I was hoping that
> getenv() or _ENV[] would have worked. I tried creating something in php.ini
> by simply adding a line, with no luck.
>
> Is there some way of doing this?
>
> Warrick
Have you considered using an auto-prepended file with the relevant values
assigned in it?
--
David Robley
Temporary Kiwi!