What would cause the <title> tag not to function?

  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 06, 2004
  • Posts: 210
  • Loc: Corpus Christi, TX
  • Status: Offline

Post February 22nd, 2009, 4:11 pm

I'm setting the title of the page using the <title> tags for my web page, but for some reason the pages still say "Untitled Document".

Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php include ("inc/conf.php"); ?>
<head>
<title>LOL</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="HAPedit 3.1">
<link href="inc/style2.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="menulist">
<div id="menuhold">
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <?php include ("inc/conf.php"); ?>
  4. <head>
  5. <title>LOL</title>
  6. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
  7. <meta name="generator" content="HAPedit 3.1">
  8. <link href="inc/style2.css" rel="stylesheet" type="text/css">
  9. </head>
  10. <body>
  11. <div id="container">
  12. <div id="header"></div>
  13. <div id="menulist">
  14. <div id="menuhold">


There's the first part of my page and Firefox AND IE display the page properly, except it is still titled "Untitled Document". The only time it works correctly is if I use dreamweavers "Preview in Browser" option. THEN the title displays correctly.

Any clue what could cause this to happen?

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 22nd, 2009, 4:11 pm

  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 06, 2004
  • Posts: 210
  • Loc: Corpus Christi, TX
  • Status: Offline

Post February 22nd, 2009, 4:28 pm

Okay so for some weird reason, I put the first PHP Include in the body of the page and it works fine now.

I would still like to know why that include was disabling the title tag..?
  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 06, 2004
  • Posts: 210
  • Loc: Corpus Christi, TX
  • Status: Offline

Post February 22nd, 2009, 4:29 pm

Nevermind I see what I did. The conf.php was not blank. I had created a new file straight to the ftp which resulted in a blank HTML page with all the tags.

Since it was in the header, the <title> tags (which were blank) in the conf.php were over-riding the ones I had set in the index.

Thanks
:D
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post February 22nd, 2009, 5:46 pm

Thanks for explaining what happened. Glad you resolved it
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post February 23rd, 2009, 5:21 am

So basically the browser uses the first <title> element it finds and ignores any further <title> elements in the page ?

That's rather interesting behavior.
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 163 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.