title: PHP Header - Content-type: image/jpeg - Not working for Internet Explorer
body: <p>We all hate Internet Explorer when building HTML templates, or modifying websites. Well I recently built a PHP image script to hide the location of the URL. It works fine for Firefox, Chrome and even Safari.</p>
  
  <p>Internet Explorer refuses to display the image from the PHP script. It does not even give the broken image icons. Simply blank squares.</p>
  
  <p>Android also has the same issue, but I can get to that another time and might be related.</p>
  
  <p>Here is my code for the image script:</p>
  
  <pre><code>$image_id = $_GET['id'];
  
  include "mysql_connect.php";
  $sql = "SELECT * FROM images WHERE code='$image_id'";
  $result = mysql_query($sql);
  $r=mysql_fetch_array($result);
  
  $imagepath=$r['path'];
  
  // Produce proper Image
  header("Content-type: image/jpeg");
  
  echo file_get_contents("$imagepath");
  </code></pre>
  
  <p>I searched high and low on Google and this website. Could not find a solid source explaining why Internet Explorer is not displaying the image.</p>
  
  <p>Any help is greatly appreciated.</p>