Hello all.
I did a few searches but came up empty on this subject, although I may be blind. I know how to create an image and all that jazz ... but am having trouble figuring out how to generate the image on the fly (from inside a curent page) without it spitting out crap characters at me.
I know you need to use the header content type of image/png - but that makes my whole page just an output of the image, as expected.
I dont even know if this is possible due to headers, but this is what I am trying to do.
I have phone numbers stored in the DB that I want output as images to prevent scrapping. I dont really want to have to create an image, only to delete it after if it is output (copy from blank, put text in, display, delete).
Here is what I've got ...
$im = imagecreatetruecolor(25,100);
$black = imagecolorallocate($im,255,255,255);
$font = '/home/XxXxXxX/public_html/fonts/tahoma.ttf';
imagettftext($im, 0, 0, 0, 0, $black, $font, $LINFO['phone']);
$content .= '<td class="INV_INFO_TEXT">'.imagepng($im).'</td>';
Ideas are welcome as I doubt I will be able to get this to work the way I'd originally thought.
TIA.