title: Wamp Server not displaying image on page inside html tags?
body: <p>why this works fine on wamp server:</p>
  
  <pre><code>&lt;?php 
   //Let's generate a totally random string using md5 
      $md5_hash = md5(rand(0,999)); 
      //We don't need a 32 character long string so we trim it down to 5 
      $security_code = substr($md5_hash, 15, 5); 
  
      //Set the session to store the security code
      $_SESSION['security_code'] = $security_code;
  
      //Set the image width and height 
  //    $im = imagecreate(97, 18);
      $im= @imagecreate(97, 18)
          or die("Cannot Initialize new GD image stream");
  
      //white background and blue text
      $bg = imagecolorallocate($im, 255, 255, 255);
      $textcolor = imagecolorallocate($im, 167, 167, 167);
  
      //Add randomly generated string in white to the image
  
      imagestring($im, 5, 27, 1, $security_code, $textcolor); 
  
  
      //Tell the browser what kind of file is come in 
      header("Content-Type: image/png"); 
  
  
      //Output the newly created image in jpeg format 
      imagepng($im); 
  
      //Free up resources
      imagedestroy($im); 
  ?&gt;
  </code></pre>
  
  <p>but this, doesn't work (just add html tags) ?</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;?php 
   //Let's generate a totally random string using md5 
      $md5_hash = md5(rand(0,999)); 
      //We don't need a 32 character long string so we trim it down to 5 
      $security_code = substr($md5_hash, 15, 5); 
  
      //Set the session to store the security code
      $_SESSION['security_code'] = $security_code;
  
      //Set the image width and height 
  //    $im = imagecreate(97, 18);
      $im= @imagecreate(97, 18)
          or die("Cannot Initialize new GD image stream");
  
      //white background and blue text
      $bg = imagecolorallocate($im, 255, 255, 255);
      $textcolor = imagecolorallocate($im, 167, 167, 167);
  
      //Add randomly generated string in white to the image
  
      imagestring($im, 5, 27, 1, $security_code, $textcolor); 
  
  
      //Tell the browser what kind of file is come in 
      header("Content-Type: image/png"); 
  
  
      //Output the newly created image in jpeg format 
      imagepng($im); 
  
      //Free up resources
      imagedestroy($im); 
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Can you tell me why inside html tags php code doesn't work on WAMP Server, but only php code works fine?</p>