[SOLVED]Need to display an image as a link...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

[SOLVED]Need to display an image as a link...

Post by grammic »

Hi everyone!

My problem is that by using gdlib, I was able to create an image that has lots of rectangles in it and everyone of them has a text.

I would like to display the text, or if not possible, the rectangles as links.

I have the suspicion that this can not be done...Any suggestion would be appreciated!

Thanks in advance.
Last edited by grammic on Thu Jan 13, 2005 7:50 am, edited 1 time in total.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

you mean like this?

Code: Select all

<a href="some_other_page.php"><img src="image_script.php"></a>
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

Post by grammic »

No...

you see the .php that has the image, includes rectangles that are not explicit objects.
I want those to be displayed as links...
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

if I understand you correctly, you want to have certain parts of an image (doesn't matter whether they're generated with GDlib or not) to be a link?
That's an HTML, not a PHP, question: use an image map.
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

Post by grammic »

Thanks for your help!

Can I do that dynamically?

I mean the images that will be displayed as links won't be always the same.

And do you have in mind any URL with information about image maps?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

HTML Image Map tutorial

http://www.dtp-aus.com/im-map.htm

there is a server-side option, but it's quite a bit more advanced:

http://httpd.apache.org/docs/mod/mod_imap.html
grammic
Forum Newbie
Posts: 19
Joined: Wed Sep 15, 2004 12:27 pm

Post by grammic »

Thanks!
Post Reply