Jump to content

head


user4fun

Recommended Posts

if i want to have meta tags for every page, but i have a main file that i include for every page called main_hdr.phpthat file has the <head> section that hold my javascipt and the tile.How would i create another head section for the other pages to hold the meta tags. Wht would happen if there is 2 <head> sections?

Link to comment
Share on other sites

You're not allowed to have two <head> elements in any HTML page. The main thing people use PHP for is to create the HTML code, so you can have 2 PHP files writing out 2 HTML <head> elements if you want to, but that's not going to make a valid HTML page. If you want to use something different on another page, either have that page include a different file or check for some variables in the include file that you would set on the other pages.

<?php$piece = 1;include 'menu.php';?>

<?phpif ($piece == 1)  //show some codeelse  //show some other code?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...