<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dan.forys.co.uk &#187; ie7</title>
	<atom:link href="http://dan.forys.co.uk/tag/ie7/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.forys.co.uk</link>
	<description>Dan is a web developer in London. He is interested in all things Internet, Linux and Mac.</description>
	<lastBuildDate>Fri, 22 Jan 2010 14:25:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Unsetting http headers in PHP</title>
		<link>http://dan.forys.co.uk/unsetting-http-headers-in-php/</link>
		<comments>http://dan.forys.co.uk/unsetting-http-headers-in-php/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 15:28:03 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[ie7]]></category>

		<guid isPermaLink="false">http://www.danforys.com/?p=40</guid>
		<description><![CDATA[I just came across a subtle issue affecting Internet Explorer users (well, fancy that!) and HTTPS connections. One of my clients has a site that downloads a series of results as a CSV file, which they open in Excel. Unfortunately, Internet Explorer was refusing to download the file, and was presenting an error message reading [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across a subtle issue affecting Internet Explorer users (well, fancy that!) and HTTPS connections.</p>
<p>One of my clients has a site that downloads a series of results as a CSV file, which they open in Excel. Unfortunately, Internet Explorer was refusing to download the file, and was presenting an error message reading &#8220;Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found.&#8221;</p>
<p>To add to my confusion, this was happening on the live server (PHP4), but not on my dev server (PHP5) <em>which both use the same code</em>.</p>
<p>In the end, I happened upon a Microsoft Knowledge Base article that <a href="http://support.microsoft.com/kb/316431">explained the problem</a>. Basically, IE obeys any &#8220;no-cache&#8221; headers you send to the browser. Without caching the file, Office applications cannot open the file when served over HTTPS.</p>
<p>How to solve the issue? Remove the cache header(s) &#8211; but how?</p>
<p>The <a href="http://uk2.php.net/manual/en/function.header.php">PHP manual</a> doesn&#8217;t make it entirely clear, and I found the solution by accident. To remove a header, use the same syntax as for setting a header, but only include a space after the colon.</p>
<p>For example, for the &#8220;Pragma&#8221; header:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pragma: '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Note:</strong> You must include the space after the &#8220;:&#8221; or the header will not be unset.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.forys.co.uk/unsetting-http-headers-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.244 seconds -->
