How would i go about making a text generator where an image is linked to a letter so if u type 'A' an A image would come up

How would i go about making a text generator where an image is linked to a letter so if u type 'A' an A image would come up
EDTALKING
PHP Code:<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>![]()
OMG I LOVE YOU
for that but
1 how would i change the font and background transparency
and 2 would this work
PHP Code:<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
imagestring($im, 5, 0, 0, "<?php include("wotever.php"); ?>", $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>
EDTALKING
Text.php:
wotever.phpPHP Code:<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
$string = file_get_contents("wotever.php");
// write the string at the top left
imagestring($im, 5, 0, 0, $string, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>
or you can have wotever.htmlPHP Code:Testing 123
PHP Code:<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
$font = '__bmreciept.ttf' << WOULD THAT WORK LOLZ
$string = file_get_contents("wotever.php");
// write the string at the top left
imagestring($im, 5, 0, 0, $string, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>
EDTALKING
Then you would have to use imagettftext instead of imagestring, it has way more varialbes depending on the font your using![]()
confuzzled :S
so like:
PHP Code:<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
$font = imagettftext(__bmreciept.ttf);
$string = file_get_contents("wotever.php");
// write the string at the top left
imagestring($im, 5, 0, 0, $string, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>
Last edited by :Edzy; 17-02-2007 at 07:51 PM.
EDTALKING
Want to hide these adverts? Register an account for free!