954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Include meta tags

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 :)

lsmith93
Newbie Poster
2 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

tbh, your question makes no sense to me

theausum
Junior Poster in Training
62 posts since Mar 2008
Reputation Points: 18
Solved Threads: 5
 

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>
Borzoi
Posting Whiz
324 posts since Oct 2006
Reputation Points: 21
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: