title: Why does this PHP tracking pixel not working correctly?
body: <p>I'm working on setting up a simple pixel tracking script with PHP, and the below technically works, but when I look at the inspector in Safari I get the following warning (1by1.gif is a 42B gif):</p>
  
  <blockquote>
    <p>esource interpreted as document but
    transferred with MIME type image/gif.</p>
  </blockquote>
  
  <pre><code>header("Content-type: image/gif");
  header("Content-Length: 42");
  echo file_get_contents("/path/to/1by1.gif");
  // do tracking stuff below here
  </code></pre>
  
  <p>I've looked at other tracking pixels, and they all show in the inspector as if they are an actual image, even with the .php extension. Any ideas how to fix that warning?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I tried doing the following and I get the same warning:</p>
  
  <pre><code>header("Content-type: image/gif");
  $img = imagecreatefromstring(file_get_contents("/path/to/1by1.gif"));
  imagegif($img);
  </code></pre>