Forum Moderators: coopster
Here is the code
<?
include('includes/config.php');
$sql123 = "SELECT * FROM nav ORDER by pos";
$query123 = mysql_query($sql123);
if($query123){
while($row = mysql_fetch_array($query123))
{
$count = mysql_num_rows($query123);
$text = $row['desc'];
$pic=ImageCreate(60,30); //(width, height)
$col1=ImageColorAllocate($pic,0,0,0);
$col2=ImageColorAllocate($pic,255,255,255);//colour1
ImageFilledRectangle($pic, 0, 0, 500, 30, $col2);
ImageString($pic, 3, 5, 8, $text, $col1);
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Header("Content-type: image/jpeg");
ImageJPEG($pic);
}}
?>
I know its not commented but don't complain. Anyone can read that and if they can't they shouldn't be.(I normally code LOTS but i wacked this together quickly).
As you can see i suck at PHP GD
In order to output multiple images, you'll really need either call the script for each image you want or you need to output the images to files then include the cached images with <img> tags.