Page 1 of 1

Pick me first!!!!!

Posted: Fri Nov 21, 2003 11:29 am
by mrvanjohnson
OK, I have what is probably and pretty basic question I just don't know the answer :-)

I have 2 main files in my application. One a configuration file which holds your typical config info like Database connections and general site things. (We'll call this file config.php - creative I know)

File number 2 is the class file (that's right named class.php). Each of these files are usually included in all my pages.

OK here's the question. I need to include the config.php into the class.php file to do some database things. At the same time I need to include the class.php into the config.php to take advantage of some key functions I created. How does this work? Which file gets included where and what will I have available to me?

Just curious.

Posted: Fri Nov 21, 2003 1:39 pm
by infolock
why not just include your functions for the config.php in your class ? :)

Posted: Fri Nov 21, 2003 1:52 pm
by Johnm
Try this:

Code: Select all

<?php
include_once('/path/class.php');
// for one and 
include_once('/path/config.php');
// for the other

?>
John M