Lunacy Posted April 29, 2013 Share Posted April 29, 2013 I am in the process of making a RuneScape fansite. I am at the portion of the project where I am making a sig generator, I am relatively new to PHP so I have been using tutorials from around the net. I have the image displaying correctly and everything but I want to echo it out onto a webpage so the user can just copy the provided urls and be fine, my problem is not that though. There is a problem with it displaying wierdly. Refer to the following screenshot: http://gyazo.com/40af1f4ade5b4a3f032052c5246c8491.png?1367255661 My code: $image_link = 'image.png'; $image = imagecreatefrompng($image_link); $font_colour = imagecolorallocate($image, 0, 0, 0); $font_size = 3; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); $i = '0'; $a = '0'; foreach($stat as $s_key => $value){ imagestring($image, $font_size, $x[$a], $y[$i], $value[1], $font_colour); $i++; if($i == '5'){ $i = '0'; $a++; } } imagestring($image, $font_size, '230', '100', 'Total:'. $overall[1], $font_colour); imagestring($image, $font_size, '240', '75', '' . $username, $font_colour); imagepng($image); imagedestroy($image); echo '<img src="http://07tools.com/sig.php?username='.$_GET['username'].'&fakeparm=.gif" />'; Quote Link to comment Share on other sites More sharing options...
Barand Posted April 29, 2013 Share Posted April 29, 2013 (edited) Remove the last line and put it on the page where you want to display the image (just as with any other image). Put the rest of the image code in sig.php edit; before the imagepng() you need header("content-type: image/png"); Edited April 29, 2013 by Barand Quote Link to comment Share on other sites More sharing options...
Lunacy Posted April 29, 2013 Author Share Posted April 29, 2013 (edited) Remove the last line and put it on the page where you want to display the image (just as with any other image). Put the rest of the image code in sig.php edit; before the imagepng() you need header("content-type: image/png"); Instead of it displaying just the dynamically generated image on that page I would like to display the generated image to my users (who generate the images through form input) automatically on a page. For example: http://www.draynor.net/signatures Edited April 29, 2013 by Lunacy Quote Link to comment 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.