PHP Include Help - Multiple <head> tags ok on includes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
omegax
Forum Newbie
Posts: 2
Joined: Thu Feb 23, 2006 10:56 am

PHP Include Help - Multiple <head> tags ok on includes

Post by omegax »

Hello all,

I'm rather new to PHP right now, all i've really messed with so far is include statements so my apologies if this is a dumb question. It's not exactly PHP related, but my includes are the only place that i've ran into this issue.

Basically what i'm doing is i'm using multiple includes on a page, sometimes for content, and sometimes for menu's etc. My question is, will I run into problems if I have multiple head tags, and meta tags on the finished page that is built? Obviously my main page has a head tag that contains meta tags, and the page that i'm calling has a head tag with its own head tag and meta tags as well. While I haven't seen any visual problems, everything looks fine visually.. but what worries me is the search engines.. will they even recognize the second head tag, and second set of meta tags? If so, which ones will they give presidence to, or will they treat them equally, and combine the two sets? My content pages change from time to time, so I can't keep static meta tags on my main page, so i'm hoping that the search engines will recognize the second set.

I looked all over the net for an answer, but I haven't been able to find anything. Any suggestions at all would be greatly appreciated, thanks.
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You could always clean your include and remove all opening HTML tags. Of course, it would seem to make sense to use cleanly coded content to prevent this type of thing from happening, but there are options out there if you want to include content that has HTML tags that shouldn't be there.
omegax
Forum Newbie
Posts: 2
Joined: Thu Feb 23, 2006 10:56 am

Post by omegax »

Thanks for responding guys.. I found out since posting that most spiders see multiple meta tags as spam anyway, so i'll just have to leave out the head and meta tags on my included document. Apparently some people use to load up their pages with tons of duplicate meta tags in an attempt to improve their ranks.. though I can't imagine that it worked that well.

Thanks again for the reply.
Post Reply