Recreational_Champ Posted November 9, 2008 Share Posted November 9, 2008 <?php header ("Content-type: image/png"); $cavas = imagecreate(300,300); $gray = imagecolorallocate ($cavas,0xcc,0xcc,0xcc); $white = imagecolorallocate ($cavas,0x33,0x33,0x33); $light_purple = imagecolorallocate ($cavas,943,387,453); $color = imagecolorallocate ($cavas,'abc',123,956); imagefilledrectangle($cavas,0,0,40,70,$white); imagefilledrectangle($cavas,0,80,20,160,$light_purple); imagefilledrectangle($cavas,0,170,70,250,$color); imagepng($cavas); ?> How can I add that image that I created to an existing page without header errors? Link to comment https://forums.phpfreaks.com/topic/132056-solved-header-errors/ Share on other sites More sharing options...
Mchl Posted November 9, 2008 Share Posted November 9, 2008 How are you doing it now? Link to comment https://forums.phpfreaks.com/topic/132056-solved-header-errors/#findComment-686203 Share on other sites More sharing options...
Recreational_Champ Posted November 9, 2008 Author Share Posted November 9, 2008 Well, thats all that I have on that page --which works well alone. It will be a graph based on poll results and I want to display other other php/html code next to that image. <?php header ("Content-type: image/png"); $cavas = imagecreate(300,300); $gray = imagecolorallocate ($cavas,0xcc,0xcc,0xcc); $white = imagecolorallocate ($cavas,0x33,0x33,0x33); $light_purple = imagecolorallocate ($cavas,943,387,453); $color = imagecolorallocate ($cavas,'abc',123,956); imagefilledrectangle($cavas,0,0,40,70,$white); imagefilledrectangle($cavas,0,80,20,160,$light_purple); imagefilledrectangle($cavas,0,170,70,250,$color); imagepng($cavas); ?> <html> <h2>Poll results:</h2> </html> make sense? Link to comment https://forums.phpfreaks.com/topic/132056-solved-header-errors/#findComment-686209 Share on other sites More sharing options...
Mchl Posted November 9, 2008 Share Posted November 9, 2008 That's not the way to do it. You should just use html <img> tags to place these pictures on the page <img src="yourimage.php" /> think of it this way: The script that creates an image is an image. For the page itself, you need another file. Link to comment https://forums.phpfreaks.com/topic/132056-solved-header-errors/#findComment-686211 Share on other sites More sharing options...
Recreational_Champ Posted November 9, 2008 Author Share Posted November 9, 2008 Beautiful!!! Thank you for your time!!! Link to comment https://forums.phpfreaks.com/topic/132056-solved-header-errors/#findComment-686213 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.