problem while include a file

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
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

problem while include a file

Post by eshban »

I want to include a file 'one.php' in my project. But in file 'one.php' one more file 'b.php' in already included which is actually the header. I just want one.php file to be included in my project not 'b.php' file. What can i do

kindly help me in this regard.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

several options come to mind:
  1. create a copy of one.php that doesn't have b.php included
  2. rewrite all files including one.php to include b.php where needed, removing it from one.php.
  3. add logic into one.php that tells it whether or not to add b.php. This can be done via a variable or analyzing the callstack.
Post Reply