Meta data with included header

1 replies
Hi,

I'm creating a new website and I'm using the PHP include function with my header to reuse it on new pages.

My problem is, if I use it like this on new pages:

PHP Code:
<?php include("header.php"); ?>
then my title, meta description and meta keywords will be the same since those are fixed in the header.php file.

So when i create a new page using the include function, how can I use title and meta data that is relevant to that page? I want these data to be different on each page.

Thanks
#data #header #included #meta
  • Profile picture of the author ussher
    <?php
    $title = "the title for this page";
    $desc = "the description for this page";
    $keyword = "keywords, relevant, to your, page,";
    include("header.php"); ?>

    then IN header.php put the print for each one
    <title><?php print $title ?></title>
    <meta name="description"><?php print $desc ?></meta>
    <meta name="keywords"><?php print $keywords ?></meat>
    Signature

    "Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."

    - jamroom.net
    Download Jamroom free: Download
    {{ DiscussionBoard.errors[4194687].message }}

Trending Topics