Help - Search - Members - Calendar
Full Version: Content-type: Text/html Shows In Webpage
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
Kama
For no reason at all that I can think of, "Content-type: text/html" shows at the top left corner of my blog webpage. It never used to be there, and just appeared one day out of the blue! I haven't made any changes to any templates that would cause this, and I've been through them all but can't see a problem.

I'm using a Mac, OSX, and Safari (although have checked in Firefox and can see it there also).

Has anyone else come across this, and any ideas on how to fix it? I'm sure it's something ridiculously simple that I just can't see!

Help would be appreciated, thanks.

kama
PRO IT Service
Hello kama,

It means that somebody broke the first one or two lines of your Web site templates.

You could get some hints here:

http://www.htmldog.com/guides/htmladvanced/declarations/

Check out your templates and see if there is any instance containing "Content-type: text/html".

Alternatively provide us here a link to your Web site.

Have a nice weekend,
Mihai Alexandru Bocsaru
Kama
Hi,

Thanks for your quick response!

I have checked all the templates and the only instances I could find were in the comment templates, where it's a meta tag looking like this:

<meta http-equiv="Content-Type" content="text/html; charset=<$MTPublishCharset$>" />

It's contained within the head tags and I can't see anything that jumps out at me.

The website is http://www.cantabrian.net
OtherNiceMan
Can you post your template please.

It appears as if there is a missing quote character or something similar which is causing the doctype to corrupt.
Kama
this is one of the comments templates, they all appear the same to me, I can't see anything missing, but an extra pair of eyes might help!

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<$MTPublishCharset$>" />

<title><$MTBlogName$>: Comment on <$MTEntryTitle$></title>

<link rel="stylesheet" href="<$MTBlogURL$>styles-site.css" type="text/css" />

<script type="text/javascript" language="javascript">
<!--

var HOST = '<$MTBlogHost$>';

// Copyright © 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
document.cookie = curCookie;
}

function getCookie (name) {
var prefix = name + '=';
var c = document.cookie;
var nullstring = '';
var cookieStartIndex = c.indexOf(prefix);
if (cookieStartIndex == -1)
return nullstring;
var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
if (cookieEndIndex == -1)
cookieEndIndex = c.length;
return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
if (getCookie(name))
document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
var base = new Date(0);
var skew = base.getTime();
if (skew > 0)
date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
var now = new Date();
fixDate(now);
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
setCookie('mtcmthome', f.url.value, now, '', HOST, '');
}

function forgetMe (f) {
deleteCookie('mtcmtmail', '', HOST);
deleteCookie('mtcmthome', '', HOST);
deleteCookie('mtcmtauth', '', HOST);
f.email.value = '';
f.author.value = '';
f.url.value = '';
}

//-->
</script>
</head>

<body>

<div class="blog">

<div class="comments-head">Comments: <$MTEntryTitle$></div>


<MTComments>
<div class="comments-body">
<$MTCommentBody$>
<span class="comments-post">Posted by <$MTCommentAuthorLink spam_protect="1"$> at <$MTCommentDate$></span>
</div>
</MTComments>

<MTEntryIfCommentsOpen>

<div class="comments-head">Post a comment</div>

<div class="comments-body">
<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">
<input type="hidden" name="entry_id" value="<$MTEntryID$>" />

<div style="width:180px; padding-right:15px; margin-right:15px; float:left; text-align:left; border-right:1px dotted #bbb;">
<label for="author">Name:</label><br />
<input tabindex="1" id="author" name="author" /><br /><br />

<label for="email">Email Address:</label><br />
<input tabindex="2" id="email" name="email" /><br /><br />

<label for="url">URL:</label><br />
<input tabindex="3" id="url" name="url" /><br /><br />
</div>

Remember personal info?<br />
<input type="radio" id="bakecookie" name="bakecookie" /><label for="bakecookie">Yes</label><input type="radio" id="forget" name="bakecookie" onclick="forgetMe(this.form)" value="Forget Info" style="margin-left: 15px;" /><label for="forget">No</label><br style="clear: both;" />

<label for="text">Comments:</label><br />
<textarea tabindex="4" id="text" name="text" rows="10" cols="50"></textarea><br /><br />

<input type="button" onclick="window.close()" value=" Cancel " />
<input type="submit" name="preview" value=" Preview " />
<br /><br />

</form>

<script type="text/javascript" language="javascript">
<!--
document.comments_form.email.value = getCookie("mtcmtmail");
document.comments_form.author.value = getCookie("mtcmtauth");
document.comments_form.url.value = getCookie("mtcmthome");
if (getCookie("mtcmtauth")) {
document.comments_form.bakecookie[0].checked = true;
} else {
document.comments_form.bakecookie[1].checked = true;
}
//-->
</script>
</div>

</MTEntryIfCommentsOpen>

</div>

</body>
</html>
OtherNiceMan
If I go to you site and go to the comments section I do not see the content type error. I do see it on you main page however, can you post the template for index.html please. Your archives do not show this error either, but they are missing doctype declarations.
sarah
Kama, is there anything above the <html> tag in the template that generates your index.html page? Is that entire page being published by Movable Type, or are you using includes, etc to pull everything into the page?

If you haven't made any changes to the template in a while, I wonder if something has changed on the server? Any .htaccess rules changed, prepending a value, etc?
Kama
Hi,

I have very limited knowledge, and didn't set this up myself...so I'm not sure how it's generated. The html tags are in my header template, and there is nothing above them.

This is the index.html template body:

CODE
<$MTInclude module="header"$>
<script language="javascript" type="text/javascript">
function OpenComments © {
window.open(c,
'comments',
'width=480,height=480,scrollbars=yes,status=yes');
}

function OpenTrackback © {
window.open(c,
'trackback',
'width=480,height=480,scrollbars=yes,status=yes');
}
</script>


<MTCloseComments old="7" inactive="3">

<MTEntries>
<$MTEntryTrackbackData$>

<MTDateHeader>

<b><$MTEntryDate format="%A, %x"$></b>

</MTDateHeader>

<br><br><font color="#333399"><b><$MTEntryTitle$></b></font>

<a name="<$MTEntryID pad="1"$>"></a>


<$MTEntryBody$>

<MTEntryIfExtended>
<span class="extended"><a href="<$MTEntryPermalink$>#more">Continue reading "<$MTEntryTitle$>"</a></span><br />
</MTEntryIfExtended>

Posted at <a href="<$MTEntryPermalink$>"><$MTEntryDate format="%X"$></a>
<MTEntryIfAllowComments>
| <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">Comments (<$MTEntryCommentCount$>)</a><br><br>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href="<$MTCGIPath$><$MTTrackbackScript$>?__mode=view&amp;entry_id=<$MTEntryID$>" onclick="OpenTrackback(this.href); return false">TrackBack (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>


</MTEntries>



<$MTInclude module="footer"$>
OtherNiceMan
Sorry to keep doing this, can we see the content of the header file.
Kama
No problem, I'm appreciating the help! Here is the header content:

<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="copyright" content="2000-2006 Kama Bailey">
<meta name="author" content="Kama Bailey">
<meta name="description" content="Kama Bailey's weblog.">
<meta name="keywords" content="Kama,Kama Sutra,weblogs,blogger,blogs,journals,diary,diaries,Christchurch,New Zealand,Aoteoroa,kiwis,kiwifruit,lizards,sheep,RSPCA,SPCA,rugby,All Blacks,Canterbury,webcams,cameras,web,photos,pictures,horoscope,Leo,music,books,">
<title>One-eyed Cantabrian</title>
<script language="javascript"><!--
function stopError() {
return true;
}

window.onerror = stopError;
// -->
</script>

<style type="text/css"><!--
a { color: #BD0000; text-decoration: none }
a:active { color: #BD0000 }
a:hover { color: #333399; text-decoration: underline }-->
</style>
<meta name="blogchalk" content="New Zealand, Canterbury, Rakaia, Rakaia, English, Kama, Female, 26-30, Horse-riding, Rugby" />
</head>


<BODY bgcolor="#e0e0e0" text="#000000" link="#BD0000" alink="#BD0000" vlink="#BD0000">
<center>

<table bgcolor="#000000" border="0" cellpadding="1" cellspacing="0" width="751">
<tr>
<td>

<table bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="0" width="750">
<tr>
<td bgcolor="#ffffff" width="200" align="left" valign="top"><img src="http://www.cantabrian.net/images/us_small.gif" alt="Kama, Zoe & Eliot"><br>
</td>

<td width="1" bgcolor="#000000"></td>

<td width="484" align="left" valign="top"><br>
<blockquote><font face="Verdana" size="1" color="black">

<b>One-Eyed:</b>(or one-sided)<br><br>

Favoring one side or group; partial or biased: a one-sided view.<br><br>
<b>Cantabrian:</b><br><br>
Person native to Canterbury, in the South Island of New Zealand.<br><br><br>

<b>This One-Eyed Cantabrian is:</b><br><br>
<b>Name:</b> Kama<br>
<b>Age:</b> 34<br>
<b>Starsign:</b> Leo<br>
<b>Location:</b> Christchurch, NZ<br>
<b>Nationality:</b> New Zealander<br></font></Blockquote>
</td>

<td width="65" bgcolor="#cccccc"><font face="Verdana" color="#cccccc">..</font></td>
</tr>
</table>

</td>
</tr>
</table>
<br>
<center><font face="Verdana" size="2" color="black"><b>"Man may have discovered fire, but women discovered how to play with it!"</b></font></center><br>






























<table bgcolor="#000000" border="0" cellpadding="1" cellspacing="0" width="751">
<tr>
<td>

<table bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="0" width="750">
<tr>
<td width="750" align="center" valign="top"><br>
<font face="Verdana" size="1"><b>
<a href="bio.html">Bio</a> || <a href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID=147415362">Snapshots</a> || <a href="canterbury.html">Canterbury</a> || <a href="nz.html">New Zealand</a> || <a href="rugby.html">Rugby</a>
</font><br><br>

<center>
<table bgcolor="#cccccc" valign="top" border="0" cellpadding="0" cellspacing="0" width="700" cols="5">
<tr>
<td valign="top">

<$MTInclude module="sidebar"$>

</td>
</tr>
</table>

</td>

<td width="10"><font face="Verdana" size="2" color="#e0e0e0">..</font></td>



<td valign="top">


<table bgcolor="#000000" border="0" cellpadding="1" cellspacing="0" width="502">
<tr>
<td>
<table border="0" bgcolor="#ffffff" cellpadding="2" cellspacing="0" width="501">
<tr>
<td align="left" valign="top" bgcolor="#BD0000"><font face="Verdana" size="2" color="white"><b>Weblog:</B></font></td>
</tr>
<tr>
<td><br><font face="Verdana" size="1">
PRO IT Service
Hi Kama,

It looks like we should take a closer look to your Weblog setup.

I would be glad to check and fix your little job for free.

Send me via email your access to MT admin and FTP server.

Cheers,
Mihai Bocsaru
Kama
QUOTE (PRO IT Service @ Feb 12 2007, 09:28 PM) *
Hi Kama,

It looks like we should take a closer look to your Weblog setup.

I would be glad to check and fix your little job for free.

Send me via email your access to MT admin and FTP server.

Cheers,
Mihai Bocsaru


Either you are VERY fast, or I just accidentally fixed it myself! It seems to have gone....
PRO IT Service
I've just corrected your problem. It was due to a useless piece of coding provided on the .htaccess file

Enjoy blogging,
Mihai Bocsaru
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.