title: PHP script throwing up garbage in browser when placed inside HTML
body: <p>So I took the PHP code that creates this page <a href="http://www.freshmarketonline.com/coupon/coupon.php" rel="nofollow">here</a>, and just put it inside of a new .php file, and uploaded that file <a href="http://pradappet.com/wp-content/coupon/coupon_new.php" rel="nofollow">here</a>.</p>
  
  <p>I just see a ton of garbage characters on the screen. Any ideas?</p>
  
  <p>Here is the full PHP below:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?
  
  // gif is more appropriate than jpg for this kind of image
  header("Content-type: image/gif");
  
  // both coupon.jpg and Helvetica.ttf must be located in the same directory as
  // dynamic.php or these variables must be updated.
  $imgname    = "./coupon.jpg";
  $fontname   = "./Helvetica.ttf";
  
  // read image from disk
  $im = imagecreatefromjpeg( $imgname )
      or die("Source coupon image has been moved or renamed! Expected coupon.jpg");
  
  // variable allocation
  $size       = 11;
  $textheight = 250;
  $imwidth    = imagesx( $im );
  $black      = imagecolorallocate( $im, 0,0,0 );
  
  // create the string containing tomorrow's date
  $text       = "Offer expires " .
      date('l\, F j\, Y', mktime(0, 0, 0, date("m")  , date("d")+1, date("Y")))."."; 
  
  // learn the width of the newly allocated string
  $bbox       = imagettfbbox( $size, 0, $fontname, $text );
  $width      = $bbox[2] - $bbox[0];
  
  // update, display, and clear from memory the newly modified image
  imagettftext($im,$size,0,$imwidth/2 - $width/2,$textheight,$black,$fontname,$text);
  imagegif($im);
  imagedestroy($im);
  
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Update added:</strong>
  My goal is to have a Google analytics conversion script on the new page / PHP generated image, is that possible?</p>