Please phpelp... multiple includes..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spacedog
    Yes that IS me. Bitch.
    • Nov 2001
    • 14149

    #1

    Please phpelp... multiple includes..

    I am trying to put this thing together,, It's in all pieces.

    Code:
    <?php
    	include '_config/config.php';
    	header('location:'.$sDefaultCountry.'/index.php');
    ?>
    That's the existing code I have in place on one page to call up script & php generated pages.. now, I also have several other pages from other scripts.. I need to tie them all together navigation wise & created a header.htm that I want at the top of all pages & the footer at bottom of all pages..

    What do I need to do so that header.htm is first, then the above, then the footer??


    header.htm footer.inc.php
  • Damian_Maxcash
    So Fucking Banned
    • Oct 2002
    • 12745

    #2
    I have just got up - and its going to take at least 2 coffees for me to just work out what the question is .... maybe later if nobody else had done it.

    Comment

    • spacedog
      Yes that IS me. Bitch.
      • Nov 2001
      • 14149

      #3
      Better yet, if I rename index.php to body.php, then is there a way I can include the 3 parts ie include header.htm & body.php & footer.inc.php & name this page index.php & when visited it displays 1st header, then body.php & last footer?

      Comment

      • u-Bob
        there's no $$$ in porn
        • Jul 2005
        • 33063

        #4
        First sending (including) an html file and then including the code you pasted (code that sends a "header('Location..."), won't work.

        Comment

        • u-Bob
          there's no $$$ in porn
          • Jul 2005
          • 33063

          #5
          Originally posted by spacedog
          Better yet, if I rename index.php to body.php, then is there a way I can include the 3 parts ie include header.htm & body.php & footer.inc.php & name this page index.php & when visited it displays 1st header, then body.php & last footer?
          Code:
          <?php
          include('header.htm');
          include('body.php');
          include('footer.inc.php');
          ?>
          btw: your header.htm is probably static html so you can gain some speed by using:

          Code:
          <?php 
          readfile('header.htm'); 
          include('body.php'); 
          include('footer.inc.php'); 
          ?>
          Last edited by u-Bob; 08-12-2006, 06:31 AM.

          Comment

          • spacedog
            Yes that IS me. Bitch.
            • Nov 2001
            • 14149

            #6
            Originally posted by u-Bob
            First sending (including) an html file and then including the code you pasted (code that sends a "header('Location..."), won't work.
            what if I rename header.htm to top.htm, or top.php?

            Comment

            • spacedog
              Yes that IS me. Bitch.
              • Nov 2001
              • 14149

              #7
              Originally posted by u-Bob
              Code:
              <?php
              include('header.htm');
              include('body.php');
              include('footer.inc.php');
              ?>
              I'm trying this,,, thanks..

              Comment

              • u-Bob
                there's no $$$ in porn
                • Jul 2005
                • 33063

                #8
                Originally posted by spacedog
                what if I rename header.htm to top.htm, or top.php?
                file name doesn't matter... PHP can't send HTTP headers followed by html followed by more HTTP headers...

                Comment

                • spacedog
                  Yes that IS me. Bitch.
                  • Nov 2001
                  • 14149

                  #9
                  I tried your code & page shows header & footer, but won't display body?

                  This also does work for the other pages I want to use this on, but not this one specific page that has the code I have in initial post?

                  Comment

                  • u-Bob
                    there's no $$$ in porn
                    • Jul 2005
                    • 33063

                    #10
                    contents of body.php?

                    Comment

                    Working...