By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

Using Universal Configuration File???

P: n/a
Hi
I want to use a universal file "settings.inc" to hold the values for 3
or 4 php scripts. I have tried including it into all the pages in the
top of the script, but have thus far been unsuccessful. Do i need to
declate the values in some special way?
Ta
matt
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
i don't see you file but 3 things come to mind:

1. path:
check if your path is set correctly. use require() instead of include()
and your script throws a fatal error if it doesn't find the file to
include

2. php tags
include() puts the php parser back into html mode, so your values need
to be inside <?php ... ?> again

3. inheritance
your values inherit the variable scope of the line your include() is
on, so if you call include inside a function your values are valid only
inside this function
micha

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.