Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php_gd2.dll problem

Status
Not open for further replies.

dropoutuser

Programmer
Feb 25, 2005
9
US
Recently I've been trying to do some work with imaging on my php page. The problem I'm getting is my code displys gibberish in firefox and nothing at all in IE. Setup is

Windows XP SP 2
Apache 2 Triad
PHP 5

Any help you could give or suggestions for using something other than php gd would be appreciated.

Code:
<?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);
    ?>
 
It's not your code. On my machine, the image outputs correctly.

I'd bet that your code is outputting a text error-message rather than a PNG image.

I recommend that you use telnet to verify your script's output. See section 2.6 of faq434-2999 for information on using telnet to fetch something from a web server.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top