raghunath Posted November 18, 2010 Share Posted November 18, 2010 Hi All, i am trying to Generate a image dynamically. Up to here i am able to do it . But when i give any echo statement with this its not working.. Here is my code pls help me in this <?php // Create a 55x30 image $im = imagecreatetruecolor(79, 79); $unknow = imagecolorallocate($im, 0, 255, 255); $white = imagecolorallocate($im, 255, 255, 255); // Draw a white rectangle imagefilledrectangle($im, 4, 4, 75, 25, $unknow); imagefilledrectangle($im, 4, 29, 75, 50, $unknow); imagefilledrectangle($im, 4, 54, 75, 75, $unknow); // Save the image echo 'hi hello'; header("Content-type: image/png"); //imagepng($im, './imagefilledrectangle.png'); imagepng($im); imagedestroy($im); ?> Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/219071-out-put-dynamic-images-with-text/ Share on other sites More sharing options...
salathe Posted November 18, 2010 Share Posted November 18, 2010 You cannot echo text and an image in the same response. Quote Link to comment https://forums.phpfreaks.com/topic/219071-out-put-dynamic-images-with-text/#findComment-1136039 Share on other sites More sharing options...
raghunath Posted November 18, 2010 Author Share Posted November 18, 2010 if not in one request how can i do in 2 requests pls let me know Quote Link to comment https://forums.phpfreaks.com/topic/219071-out-put-dynamic-images-with-text/#findComment-1136040 Share on other sites More sharing options...
BlueSkyIS Posted November 18, 2010 Share Posted November 18, 2010 you'd need to have one page that includes 1. the php file that creates the image and 2. the php file that echo's content. Quote Link to comment https://forums.phpfreaks.com/topic/219071-out-put-dynamic-images-with-text/#findComment-1136091 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.