Hello
First time out with php and I am seeking to end my trial and error attempts at solving the last little bit of the task in hand.
The task is: Iam using a .php image generator ( namely Stewart Rosenberger's Dynamic Heading Generator) to convert a text string to a .png image. The text is input by a simple HTML form on a web page using the GET method to call the script 'heading.php'.
'heading.php' outputs the required .png image back to the browser from (I presume) the function:
<?php (snippet)
// send an image
if(function_exists('ImageCreate'))
{
$width = ImageFontWidth(5) * strlen($message) + 10 ;
$height = ImageFontHeight(5) + 10 ;
if($image = ImageCreate($width,$height))
{
$background = ImageColorAllocate($image,255,255,255) ;
$text_color = ImageColorAllocate($image,0,0,0) ;
ImageString($image,5,5,5,$message,$text_color) ;
header('Content-type: image/png') ;
ImagePNG($image) ;
ImageDestroy($image) ;
exit ;
}
}
?>
This generates the required image in a new browser window.
What I want to do is have 'heading.php' place the image in the original web page that the script was called from, possibly in an <iframe> but any method will do.
The desired result is that the user types in some text on a sbmit form on the web page, clicks 'submit' and sees the image generated in a box beside the submit form so that the process can be repeated if desired with various fonts and colours.
At present, it works okay but the user is given the image on a blank page which means using the back button to get back to have another go.
All help much appreciated.