9999 Posted March 22, 2007 Share Posted March 22, 2007 I can get this to work if I manually type in some text and assign it to the $text variable. When I try to assign a file to the text variable all that is displyed is "array". Also, what would be the correct way for me to save the image as "testimage.gif"? <?php $text = file('myfile.php'); // file used for output data $im = imagecreate(325, 160); // create a 325*160 image $bg = imagecolorallocate($im, 0, 0, 0); // black background color $textcolor = imagecolorallocate($im, 255, 215, 0); // gold text color imagestring($im, 5, 0, 0, $text, $textcolor); // write the string at the top left // output the image header("Content-type: image/gif"); imagegif($im); // save the image imagegif($img,"testimage.gif",80); ?> Thanks Link to comment https://forums.phpfreaks.com/topic/43783-imagecreate-question/ Share on other sites More sharing options...
fert Posted March 22, 2007 Share Posted March 22, 2007 file creates an array containing the lines in the file Link to comment https://forums.phpfreaks.com/topic/43783-imagecreate-question/#findComment-212571 Share on other sites More sharing options...
9999 Posted March 22, 2007 Author Share Posted March 22, 2007 OK, I am a newbie. What I want it to do is display the result of a php file in the box instead of text I type. What do I need to do that? Link to comment https://forums.phpfreaks.com/topic/43783-imagecreate-question/#findComment-212574 Share on other sites More sharing options...
9999 Posted March 22, 2007 Author Share Posted March 22, 2007 Kinda like what fert is doing im his signature. Link to comment https://forums.phpfreaks.com/topic/43783-imagecreate-question/#findComment-212576 Share on other sites More sharing options...
9999 Posted March 22, 2007 Author Share Posted March 22, 2007 What do I use to open/run the php file? Link to comment https://forums.phpfreaks.com/topic/43783-imagecreate-question/#findComment-212921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.