My server supported as " GD support : enabled" (linux OS using)
but this program not displayed the graph.
displayed the message "The image “http://xxx.xxx.xxx.xxx/test3.php” cannot be displayed, because it contains errors.
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
What is the problem with the code?
thanks in advance
Give me suggestion!

When you see this error, take out the content-type declaration, You're probably getting an error from PHP, but because of content-type the browser is preventing you from seeing what is wrong.

// header("Content-type: image/png"); <-- comment out.

When you get a bunch of text with PNG on the front, you can put it back in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.