nedloh312
08-28-2007, 12:38 PM
I have a piece of code for a nav bar that will create dynamic images that are linked on the main page. But, the problem is that it wont loop through different descriptions of the link
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))
{
$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);
}}
?>
As you can see i suck at PHP GD
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))
{
$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);
}}
?>
As you can see i suck at PHP GD