Forum Moderators: coopster

Message Too Old, No Replies

Constants bleed

         

bleak26

12:22 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



I have 4 websites which run using the same code and which vary from each other only by a few config files.
The config files contain constants. The config files are called using include statements
include_once($_SERVER['DOCUMENT_ROOT']."/config.php");

which makes the constants availible throughout my website.
My problem is that sometimes the constants from my other domains seem to leek and i find for example: the contents of SITEURL for one site containing the contents which should be only present in another site.

I have fully checked my code for hardcoded paths or url's which might be causing this, but there are none.

Has anyone experianced a simular situation? and if so how did you solve it?

Also could anyone tell me if there is a method to print all the currently defined constants.

once again thank you for all your help

eelixduppy

12:31 pm on Sep 27, 2006 (gmt 0)



This doesn't make much sense. To echo all the constants defined, use this:

echo '<pre>';
print_r([url=http://us3.php.net/manual/en/function.get-defined-constants.php]get_defined_constants[/url]());
echo '</pre>';

Make sure you aren't defining the constants that you don't want.

good luck!

bleak26

3:51 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



Thank you for the help

I was using auto prepend and it turns out dreamweaver does not search .htaccess files when you search an entire sites source code, so i could not find the 1 hard coded reference.

We live and learn

barns101

5:35 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



I have found that my (Windows-based) search and replace application cannot search within some files that I have downloaded via FTP because it turns out that they are saved in *nix format rather than MS-DOS (according to my text editor).