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? Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 9, 2008 Share Posted November 9, 2008 How are you doing it now? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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!!! 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.