Re: Undefined constant errors - possible global variable problem?

From: Date: Wed, 24 Mar 2004 08:11:19 +0000
Subject: Re: Undefined constant errors - possible global variable problem?
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-13037@lists.php.net to get a copy of this message
michaelrflora@netscape.net wrote:
Hi, I have little experience with php. I am installing an application that uses php with embedded html. When I use Netscape 7.1 to access the application, I get lots of warnings. Here is an example: Warning: undefined constant 'general_user_attrs' used as general_user_attrs in /var/www/html/dialup_admin/htdocs/user_new.php3 line 12 The constant general_user_attrs is a user-defined parameter defined in the .conf file for the application. The .conf file is read in by a php function that stores all parameters in an array called $config. This array is referenced in php files throughout the application tree. It *appears* that $config is not being passed by php to all the separate files. Do I have to manually configure php to do this? Or is the problem something else altogether? This application (dialup_admin) is not a beta, rather is in general use. I am using Red Hat 7.2, PHP 4.0.6, Apache 1.3.20. Regards, Michael Flora InfinET LLC "You know my method. It is founded upon the observance of trifles." -- Sherlock Holmes in "The Boscombe Valley Mystery" How are you passing $config from file to file? (You do not show us what is in line 12 or the first occurance of $config in the file). It either needs to be in a $_SESSION variable or you application needs register_globals turned on in php.ini.
HTH Chris

« previous php.install (#13037) next »