I have a php generated image called jobimg.php3. Here is the code:
<?php
Header( "Content-type: image/gif");
$conn = pg_connect("dbserver", "5432", "dbname");
$cat_query = "select distinct cat from jobs order by cat;";
$cat_result = pg_exec($conn,$cat_query);
$numcat = pg_numrows($cat_result);
$image_height = $numcat * 20;
$image = imagecreate(380,$image_height);
$offcolor = imagecolorallocate($image,255,255,204);
$oncolor = imagecolorallocate($image,204,153,0);
$black = imagecolorallocate($image,0,0,0);
for($i=0;$i<$numcat;$i++)
{
$category=pg_fetch_array($cat_result,$i);
$imgcat = ereg_replace (" ", "_", $category[0]);
$down = (($i * 20) + 1);
imagestring($image, 4, 5, $down, $category[0], $black);
}
ImageGIF($image);
ImageDestroy($image);
?>
And then I have another php page that creates this image into an imagemap.
Here is the map:
<map name="slice">
<?
require ("function.php3");
$conn = pg_connect("dbserver", "5432", "dbname");
$cat_query = "select distinct cat from jobs order by cat;";
$cat_result = pg_exec($conn,$cat_query);
$numcat = pg_numrows($cat_result);
for($i=0;$i<$numcat;$i++)
{
$category=pg_fetch_array($cat_result,$i);
$y1 = $i * 20;
$y2 = $y1 + 20;
?>
<area alt="<? echo $category[0]; ?>" coords="0,<? echo $y1; ?>,380,<? echo $y2; ?>" href="job.php3?var=cat&def=<? echo(changehex($category[0])); ?>&ord=day%20desc">
<?
}
pg_close($conn);
?>
</map>
<img src=jobimg.php3 border=0 usemap=#slice ismap>
What I want to do is make it so whatever section the user rolls his mouse over, it will change colors like a javascript rollover. Is there a way of doing it with php.
Also if instead of creating one large image if I break it up to many smaller images with rollovers(that I can do) is there a way of creating php image files on the fly so I don't have to create many php files that all are basically the same.
I don't know if I am clear. Let me know if you can help me or if you need any more clarification.
Thank you,
Tim.