> how can I use global variables in my web portal? I have read the php
> documentation, but it works only in the same file.
> I want use more global variable on many php site.
> 
> For example:
> In login.php I use the code
> 
>          $first=mysql_result($result,0,"FIRST_NAME");
> 
> and I want to print this $first variable all of my php site.

You can't. You can, however, have a config.php or type page that's
include()'d on every page in your site where you define these variables.
For things like this that you draw from the database, it would be a good
idea to query once and add to the session.

I find it useful to use something like a $_CONF[] array.

$_CONF['user'] = 'user';
$_CONF['path'] = '/home/user/htdocs/';

etc...

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to