Jump to content

[SOLVED] Gd will not display pictures


madspof

Recommended Posts

I cannot get the gd feature to work with the scripts that are shown in one of the php freaks tutorials.

Here is the code that i am try to get to work:

<?php
Header("Content-type: image/png");
$height = 300;
$width = 300;
$im = ImageCreate($width, $height);
$bck = ImageColorAllocate($im, 10,110,100);
$white = ImageColorAllocate($im, 255, 255, 255);
ImageFill($im, 0, 0, $bck);
ImageLine($im, 0, 0, $width, $height, $white);
for($i=0;$i<=299;$i=$i+10) {
ImageLine($im, 0, $i, $width, $height, $white); }    
ImagePNG($im);
?> 

and here is the error given

The image “http://192.168.2.3:1128/testing/gd/pic.php” cannot be displayed, because it contains errors.

Link to comment
https://forums.phpfreaks.com/topic/69094-solved-gd-will-not-display-pictures/
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.