I have a include file called sign.php which has some code -
header('Content-type: image/png');
.....
imagepng($image_file);
.....
A file where I want to display this image - index.php
......
<what comes here?> include('../sign.php');
.....
How would I display it? Directly echo-ing it doesn't work!
Thanks.
MORE CODE:
sign.php
.....
{
imagettftext($im, 22, 0, 240, 43 , $text_color, $font, $text_god);
imagettftext($im, 22, 0, 241, 44 , $text_color, $font, $text_god);
}
imagettftext($im, 22, 0, 60, 42 , $text_color, $fontname, $text_username);
imagettftext($im, 16, 0, 230, 72 , $text_color, $font, $text_kills);
imagettftext($im, 16, 0, 230, 102 , $text_color, $font, $text_deaths);
imagettftext($im, 16, 0, 230, 132 , $text_color, $font, $text_rwon);
imagettftext($im, 16, 0, 365, 72 , $text_color, $font, $text_alevel);
imagettftext($im, 16, 0, 365, 102, $text_color, $font, $text_dlevel);
imagettftext($im, 16, 0, 365, 132 , $text_color, $font, $text_rlost);
imagettftext($im, 16, 0, 365, 162 , $text_color, $font, $text_money); // Prints the money in the picture.
imagecopymerge($im, $skinImg, 505, 56,0,0,55,99,100);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
index.php
.......
<?php echo '<img src="../signature/sign.php" />'; ?>
.......
Still doesn't work!
EDIT:
index.php
include('../signature/sign.php');
echo '<img src="data:image/png;base64,' + base64_encode($stringdata) + '">';
sign.php