Hi guys and girls,
I've ran into a problem with PHP, I'm a C++ programmer by trade but a certain contract requires I use PHP. However my problem is as follows:
I'm trying to seperate all the PHP logic from inline (I know class constructs etc will still need to be inline) to make it more manageable - however I'm wanting to store global parameters in a global.inc.php file i.e. database server, username, password etc etc and include this in a MyClass.class.php file so the constructor of the class can access these - but it doesn't seem possible. I've heard that this isn't a feature in PHP?!?!?!?!
My directory structure looks something like:
- ROOT
- classes
- MyClass.class.php (the class wanting to use the global.inc.php)
- config
- globals.inc.php (contains the global config files for this site)
- admin.php
And so in the MyClass.class.php I have
include("../config/globals.inc.php")
but it doesn't seem to work...
Is there some other way around this? Before you answer please bear in mind that the server is many miles away and I have NO access to the php.ini file.
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).