title: a php page in img src
body: <p>I am trying to create a html page that uses a php page to decide what image to display at a set time. </p>
  
  <p>The only problem is when i go to the php page it will display the correct image, but when i try to img src the php page, it gives a dead link on the HTML page. Here is the code I am using on the HTML and PHP page.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;img src="http://itcacher85.hostzi.com/getImage.php" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>getImage.php:</p>
  
  <pre><code>&lt;?php
  header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
  header('Expires: January 01, 2013'); // Date in the past
  header('Pragma: no-cache');
  
  $h = date('Hi');
  
  if ($h &gt;= 2100 &amp;&amp; $h &lt; 2230){ $img = '40px-Dni5.png'; }
  elseif ($h &gt;= 2230 &amp;&amp; $h &lt; 0000){ $img = '40px-Dni3.png'; }
  
  elseif ($h &gt;= 0000 &amp;&amp; $h &lt; 0130){ $img = '40px-Dni7.png'; }
  elseif ($$h &gt;= 0130 &amp;&amp; $h &lt; 0137){ $img = '40px-Dni6.png'; }
  
  elseif ($h &gt;= 0137 &amp;&amp; $h &lt; 0138){ $img = '40px-Dnisolve.png'; }
  elseif ($h &gt;= 0138 &amp;&amp; $h &lt; 0300){ $img = '40px-Dni6.png'; }
  
  elseif ($h &gt;= 0300 &amp;&amp; $h &lt; 0430){ $img = '40px-Dni4.png'; }
  elseif ($h &gt;= 0430 &amp;&amp; $h &lt; 0600){ $img = '40px-Dni5.png'; }
  
  else{ $img = 'where.png'; }
  ?&gt;
  
  &lt;img src="&lt;?php echo $img; ?&gt;"&gt;
  </code></pre>
  
  <p>This code will display the image fine if you go to the PHP page, but when you link it as an image it does not work. I did a little research and found that I might need to add a header:</p>
  
  <pre><code>header('Content-type: image/png');
  </code></pre>
  
  <p>but when I add that in i get a dead link and no image is displayed on either the php page or the HTML page. Any help would be greatly appreciated.</p>