Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.