Including multiple php file using include

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aswathip
    New Member
    • Jan 2009
    • 16

    Including multiple php file using include

    When i tried to include multiple files using include() it didn't work as expected.

    catagorization. php includes the following code
    Code:
     include("ajax_catagorization.php"); 
     include("categorization_total.php");
    This way it does not work. But if only one file is included it works properly

    Can anybody please help me to solve this?

    thanks
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Do you get any errors? The code you posted *should* work.

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      Silly question, but none of those files exit() or anything like that? As it has already been said, you can include as many files as required. Some of my pages have about 20 include's with no html. The only thing I can think of is checking each file for errors that might be stopping it and not outputting an error.

      Put an echo statement at the bottom of the first and at the top of the second and see if they print.

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        you could use FF and then check the generated source on the resultant page, also are the paths correct for the files and the spelling. It's always worth double checking, I've been caught out myself on that one.

        Comment

        • aswathip
          New Member
          • Jan 2009
          • 16

          #5
          Thanks for those replies

          I tried my best to clear that error. I tried with echo also.
          Now what i did is,
          the function that i wanted from categorization_ total.php i included in this page also. This avoided the necessity to include that page. And i am sure that this is never a good coding technique.

          Comment

          Working...