Pick me first!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Pick me first!!!!!

Post 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.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

why not just include your functions for the config.php in your class ? :)
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
Post Reply