Click to See Complete Forum and Search --> : Image creation


Nirmal
01-18-2006, 10:05 PM
Hi

I want show certain php page that displays a number in html tag<IMG> as
<IMG src="generatenumber.php">
How Can I do this....Is it possible?

bye

bokeh
01-19-2006, 06:12 AM
What are you trying to create. Whatever it is it sounds pretty simple but please try to give comprehensive information so a relevant answer may be posted.

Mester Pediz
01-19-2006, 06:16 AM
If it's what it sounds like your trying, then you just need
<?php
$randNum = rand(1,whatevermaxnum);
print "<IMG src=\"randNum.php\">";
?>

This will generate a random number between 1 to what ever your max is.
Dunno if it's what you need but see if it'll do the job :)

bokeh
01-19-2006, 06:27 AM
I think he is asking how to create the image generator, but I could be wrong.

Nirmal
01-19-2006, 07:00 AM
Hi

Thanks for your response

I got the code for image creation dynamically


here is the code


header("Content-type: image/png");
$text_width = imagefontwidth($font_type)* strlen($nu);
$text_height = imagefontheight($font_type)+10;
$im = imagecreate($text_width+10, $text_height); /* Create a blank image */
$bgc = imagecolorallocate($im,$bckcolor[0], $bckcolor[1], $bckcolor[2]);
$tc = imagecolorallocate($im,$forecolor[0], $forecolor[1], $forecolor[2]);
imagefilledrectangle($im, 0, 0, 150, 26, $bgc);
imagestring($im, $font_type, 5, 5, $nu, $tc);
imagepng($im);
imagedestroy($im)

bokeh
01-19-2006, 07:05 AM
Nirmal, unless you ask a question it is impossible to give you an answer.