0

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!

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by bigattichouse
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.