You are here: dynamic image and area creation « PHP Programming Language « IT news, forums, messages
dynamic image and area creation

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация