Holy whoa! You can generate Flash movies with PHP??? Visionmaster, as for your problem, may I present to you, the solution using GD. The following script will pull the data out of a mysql database and output it on a white image in black letters. I will also attempt to explain each line:
Code: Select all
<?php
//I assume you are pulling your information from a database, so you want to perform a query:
$db = mysql_connect ("localhost", "", "");
$result = mysql_query ("SELECT address FROM table WHERE /* condition */", $db);
$information = mysql_fetch_array($result);
//generate a new image, allocate space for it
$newimage = imagecreatetruecolor(100, 33); //10 and 33 is the image size in pixels
//set the background colour to white, and define what "black" means
$background = imagecolorallocate($newimage, 255, 255, 255);
$fill = imagefill($newimage, 0, 0, $background);
$black = imagecolorallocate($newimage, 0, 0, 0);
//write your information in black letters to the image
imagestring($newimage, 5, 10, 10, $information['address'], $black); //5 is font information, 10,10 are the coordinates where the text will be placed
//create, output, and destroy the image
header("Content-type: image/png");
imagepng($newimage);
imagedestroy($newimage);
?>
Assuming you saved this script as image.php, you can access it from a regular html page using
You can even pass variables like you would to any other php script:
Code: Select all
<img src = "image.php?var=value&anothervar=anothervalue">
Small note, this actually outputs a png, not a gif. You can change this a little so it outputs a jpeg if that's your preference, personally, I prefer png's. This will increase the loading time of the page (obviously!) because not only does the image have to be downloaded by the end user, it also has to be created by the server. However, for what you ask, I don't see any other solution.
Hope this helps you!
~evilmonkey.