Jump to content

GD not working.


XJTRy

Recommended Posts

Never worked with GD before but I'm trying to use it for simple instances of dynamic buttons. I've just tried to cut/paste simple examples I've found on the internet on a test page but my browser won't render the image. My host is 1&1 Linux and running a check_info.php on one of my domains shows that GD is installed and enabled. Anyway, my browser returns this when I try the code below: �PNG IHDR�����������������PLTE� �r�`�L����IDAT(��бA�MhF�!�a�+(�W��&�;�x��Z���i'J�D�R�+�0w��`�����f�Sc�CYe�G�E����*T,(�����Pe�|&H�;?&���ֳ�54I�%����ב[��!�i�)1kg$;�P E��o���,{��z���:`����̔���,�fS�8���7Ȑ��E��E��,�N��@�4&��g��G�2�'��D?�<_F����IEND�B`�

 

 <?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);
    ?> 

Link to comment
https://forums.phpfreaks.com/topic/194375-gd-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.