xue Posted June 22, 2007 Share Posted June 22, 2007 Hi, I am using the xamp installation. My GD library is enabled. But when i run this code in the GD tutorial, I encountered this problem with a warning like this:Warning: Cannot modify header information - headers already sent by... My code is as follows:<?php header ("Content-type: image/png"); $img_handle = ImageCreate (230, 20) or die ("Cannot Create image"); $back_color = ImageColorAllocate ($img_handle, 0, 10, 10); $txt_color = ImageColorAllocate ($img_handle, 233, 114, 191); ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color); ImagePng ($img_handle); ?> Can somebody tell me what is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/56743-warning-cannot-modify-header-information-headers-already-sent-by/ Share on other sites More sharing options...
wildteen88 Posted June 22, 2007 Share Posted June 22, 2007 Can you post the full error message you get. Also how are you using this code? Are you using it on its own or are you including this within a script somewhere? Quote Link to comment https://forums.phpfreaks.com/topic/56743-warning-cannot-modify-header-information-headers-already-sent-by/#findComment-280232 Share on other sites More sharing options...
xue Posted June 23, 2007 Author Share Posted June 23, 2007 Thank you very much to reply me. My code works today...Damn weird Quote Link to comment https://forums.phpfreaks.com/topic/56743-warning-cannot-modify-header-information-headers-already-sent-by/#findComment-280928 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.