happy2learn Posted May 28, 2007 Share Posted May 28, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/53260-using-php-to-insert-header-title-and-meta-tags/ Share on other sites More sharing options...
trq Posted May 28, 2007 Share Posted May 28, 2007 This is more than likely caused by invalid html... can we see your actual code? PS: This is PHP's equivalent of the ASP you pointed out. <?php echo $title ?> Quote Link to comment https://forums.phpfreaks.com/topic/53260-using-php-to-insert-header-title-and-meta-tags/#findComment-263172 Share on other sites More sharing options...
Vinze Posted May 28, 2007 Share Posted May 28, 2007 Just a wild guess, but perhaps you placed <title> outside of the <head>? Quote Link to comment https://forums.phpfreaks.com/topic/53260-using-php-to-insert-header-title-and-meta-tags/#findComment-263183 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.