User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,528 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 394 | Replies: 1
Reply
Join Date: Sep 2006
Posts: 12
Reputation: fernandodonster is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
fernandodonster fernandodonster is offline Offline
Newbie Poster

Gd

  #1  
Oct 19th, 2007
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!
Last edited by fernandodonster : Oct 19th, 2007 at 3:55 am. Reason: currection
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Chenoa, IL
Posts: 13
Reputation: bigattichouse is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
bigattichouse's Avatar
bigattichouse bigattichouse is offline Offline
Newbie Poster

Re: Gd

  #2  
Oct 26th, 2007
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.
Need a simple, powerful knowledgebase? Bigattichouse Knowledge Base finds the solution while you're still typing the problem.
http://www.bigattichouse.com/knowledgebase.html
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC