Page title with MULTIPLE include pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DavidFin
    New Member
    • Sep 2010
    • 1

    Page title with MULTIPLE include pages

    I am putting together a website using php include and I am finding it difficult to find a way to include the title and meta tags from each include file since the page I am including them on already has, and needs, a header tag for java pop up menu. I found what seems to be a solution but it only works for one include page.

    Code:
    <html>
    <head>
    <?php
    ob_start();
    ob_implicit_flush(0);
    $incPage = "folders/my_include.php";
    include($incPage);
    $pageContents = ob_get_contents();
    ob_end_clean();
    ?>
    <title><?php print($pagetitle); ?></title>
    </head>
    <body>
    <?php print $pageContents; ?>
    </body>
    </html>

    My php is for multiple pages so how could I do that?

    Thanks in advance.

    Dave
    Last edited by Markus; Sep 17 '10, 04:56 PM. Reason: Added [code][/code] tags
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Put all the header stuff in a seperate file and call it with include_once

    Comment

    Working...