|
Posted by sathyashrayan on July 11, 2008, 10:01 am
Please log in for more thread options
>> Tony B wrote:
>>> I'm trying to understand some code on a php site I'm looking at.
>>> Each page in the site has a require('filenames.php'); statement in the
>>> header.
>>> filenames.php has typical entries like
>>> define('FILE_INDEX',DEFAULT_FOLDER .'index.php');
>>>
>>> php warns that DEFAULT_FOLDER is unknown with a message like
>>> Use of undefined constant DEFAULT_FOLDER - assumed 'DEFAULT_FOLDER' in
>>> filenames.php on line 2
>>>
>>> What is DEFAULT_FOLDER ? I searched uk.php.net and couldn't find a
>>> reference to this variable ?
>>
>> Well, it is not defined, obviously. You'll need to define it the same way
>> as FILE_INDEX.
>>
>> Check "define" in the PHP docs and "constant". The DEFAULTS_FOLDER is a
>> constant whose define is missing in your code.
>>
>> Jeff
>>
> I didn't write the code, but was just trying to understand it. I assumed
> that default_folder must be some sort of php defined variable, which it
> doesn't seem to be. I guess whoever wrote the code never used the defines
> since they don't make sense. My guess is maybe DEFAULT_FOLDER is supposed
> to be defined as the site root folder path as then FILE_INDEX would point
> to the main home page ?
> Tony
>
Those defines might be in a config.php or in the include folder.
>
|