cleeclee Posted September 24, 2012 Share Posted September 24, 2012 (edited) I'm having some troubles with displaying the graphs. It shows a broken image when i run it. Below is my code. I have also attached a picture that should say that my gd library is working? Could i know which part of my code has to be corrected for it to display the graph i want? <?php header ("Content-type: image/png"); $x1=$_GET['x1']; $x2=$_GET['x2']; $y1=$_GET['y1']; $y2=$_GET['y2']; $im = @ImageCreate (100, 200) or die ("Cannot Initialize new GD image stream"); $background_color = ImageColorAllocate ($im, 224, 234, 234); $text_color = ImageColorAllocate ($im, 233, 14, 91); // imageline ($im,$x1,$y1,$x2,$y2,$text_color); imageline ($im,0,0,100,200,$text_color); imageline ($im,100,0,0,200,$text_color); ImagePng ($im); ?> Edited September 24, 2012 by Zane Please make use of our [code] tags Quote Link to comment https://forums.phpfreaks.com/topic/268719-displaying-graphs/ Share on other sites More sharing options...
scootstah Posted September 24, 2012 Share Posted September 24, 2012 Comment out: header ("Content-type: image/png"); ImagePng ($im); and remove the @ from ImageCreate(). Do you see any errors now? Quote Link to comment https://forums.phpfreaks.com/topic/268719-displaying-graphs/#findComment-1380473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.