12-29-2007, 05:38 AM
|
#9 (permalink)
|
|
The Wanderer
Join Date: Dec 2007
Location: 127.0.0.1
Posts: 18
Thanks: 7
|
nefus, you get the warning "Cannot modify header information..." because imagettftext() has also caused a warning which has already been displayed. A HTTP response contains two parts: The header and the body. You can't mix them! That's what has happened here. Your websever (most likely Apache because of XAMPP) sent the header first. Then PHP caused a warning which threw an output. Because Apache does not store both parts in a local cache for performance reason it will send all the data to the client. Meaning when you output something Apache will end the header and will 'initialize' the body so that it isn't possible anymore to send headers. Ok, regarding your problem. It seems so that the font (in this case templates/ChalkboardBold.ttf does not exist). imagettftext() isn't able to find it that's because it threw the warning. Just try arial.ttf or any other font that's installed on your system. On production systems there shouldn't be any PHP warnings and errors shown at all! People could use the provided information and might be able to break into your system especially if it's a Windows-based server  . I recommend you to use an error handler. If you're interested in I could publish one I've written some time ago.
Cheers,
Tim
|
|
|
|