|
Posted by dino d. on 10/01/07 19:13
Hi- I want to create a dynamic image with areas so that when the user
clicks different areas, the user jumps to those pages. The problem
is, I can't seem to figure out how to do this efficiently.
Suppose I have a table,items in a database:
itemid description count
So, basically, I want to create an image that has 3 ovals,
representing the top 3 occurring items (with the highest count) in
this table. So, first, I create the image html:
echo "<image src=genimage.php?items=$itemstring...
So, here, I pass genimage a string that encodes the keys for the top 3
occurring items. And in genimage, a query is created and called to
get the descriptions and counts, and then displays those descriptions
and counts in the ovals.
The problem is, now I have to do this all over again to generate the
area tags and corresponding jump URLs. Why? because I can only send
the data in a GET string, since the image source has to be a url. So,
I'm calling the identical query twice-once inside the image
generation, and once in the area generation.
I suppose I *could* get all the data once (the item descriptions and
counts) and encode all of that and send that as a data string, but
there has to be an easier way.
Another suboptimal solution is to generate a temporary image and
create img link to that image, but I'd rather keep these dynamic.
So, is there a way create and then embed an image directly into a
page? Or must I use a URL reference?
In other words, what I'd like to do is something like:
echo "<img src= THIS IMAGE STREAM I'M GENERATING RIGHT NOW...
Any ideas on if this can be accomplished?
Thanks,
Dino
Navigation:
[Reply to this message]
|