Just wondering but is there a way to include the meta tags from one page to another?

The reason why i ask this is that i built a website using PHP Includes and want to include the meta tags so when i load index.php?id=About , it will load the meta tags from the include page and not from the main index.php page?

Before you suggest using URL Rewrite to make the URL's look better i already am :)

Let me know if you have a answer to this :)

Recommended Answers

tbh, your question makes no sense to me

Jump to Post

All 2 Replies

tbh, your question makes no sense to me

What you could do is have multiple header files to include with the different meta tags you require and include the necessary one depending on the page you're loading.

For example: On index.php?id=about you could include the header file headabout.php and on index.php?id=contact you could include the headerfile headcontact.php using the $id variable as it's set in the URL.

<head>
  <?php
    include "head$id.php";
  ?>
</head>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.