Jump to content

Using PHP to insert header TITLE and META TAGS


happy2learn

Recommended Posts

Hi

 

I'm trying to customise PHP pages by setting variables for the page Title and the Meta Tags for Description and Keywords.

 

I did this by creating three variables - $title, $description and $keywords at the head of individual pages, then inserting the following code into my header.php file which delivers the header and left column (nav) to each page of the site:

 

<title><?php echo $title ?></title>

 

and similar code for the meta tags for description and keywords.

 

No problems with Firefox, but in IE6 I get the $title printed at the top of the page instead of in the blue bar at the top of the browser.  Yet no meta tags are printed on the page - but they appear normally along with the title in the page source.

 

 

Is this a quirk in IE (which I loathe, but I know so many people use) or something I've done incorrectly in my code?

 

In ASP you can write <% =strTitle %>  but is there something similar in PHP that I haven't discovered yet?

 

Any help will be greatly appreciated.

 

Regards (from Australia)

 

happy2learn

 

 

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.