BoGFx Posted July 22, 2010 Share Posted July 22, 2010 Hello MWG, I am in need of a tad bit of help. I need to create a dynamic image, with text, and the text needs to be able to use HTML. I can only get 2/3 the way with php GD. I can not get html to work in php GD. Example: $info ="<a href=google.com>Google</a>"; $image = imagecreatetruecolor(200, 100); $black = imagecolorallocate($image, 0x00, 0x00, 0x00); $font_file = 'images/arial.ttf'; imagettftext($image, 8, 0, 0, 1, $black, $font_file, $info); header('Content-Type: image/png'); imagepng($image); imagedestroy($image); ?> That would just return <a href=google.com>Google</a> Any help? Thanks Quote Link to comment Share on other sites More sharing options...
Zeggy Posted July 22, 2010 Share Posted July 22, 2010 An image is an image, html belongs in a browser. If you want the image to link to something, you need to link it with . If you want parts of the image to link to different pages, you can use image maps. Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted July 22, 2010 Share Posted July 22, 2010 As zeggy stated, the PHPGD library will remove any type of HTML from your image, thus HTML will not appear. Quote Link to comment Share on other sites More sharing options...
CJ - Twitch Posted July 23, 2010 Share Posted July 23, 2010 PHP GD is a fairly hard tool to work with. As stated above HTML is a browser thing with images do not process. An alternative would be to learn flash and PHP. Good luck - Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted July 26, 2010 Share Posted July 26, 2010 PHP GD is a fairly hard tool to work with. As stated above HTML is a browser thing with images do not process. An alternative would be to learn flash and PHP. Good luck - PHP GD is actualy an easy framework if you have worked with it before. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted July 26, 2010 Share Posted July 26, 2010 i found GD interesting but i have only worked with it once. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.