[thelist] replace text link with image php

Ben Phillips ben at inchima.com
Mon Apr 15 10:10:01 CDT 2002


> which displays the test as a link what i want to do is call
> an image that represents the text?  does this sound possible?

if you know what the text is going to be, then you can prepare the image
in advance, have it on the server, and then call it like this:

: echo "<A href=\"products.php?m=$m&g=". substr (md5 ($s[1]), 0, 10)
."\"><img src=\"$s[1].gif\" alt=\"$s[1]\"></A>";

if the text is 'Carrots', this will show Carrots.gif.

if you don't know what the text is going to be, then you need to
generate the images on the fly. try ImageMagick:
<www.imagemagick.org/> or PHP's built in GD functions (if they are
included in your install):
<http://www.php.net/manual/en/ref.image.php> &
<http://www.boutell.com/gd/>

benji
inchima.com






More information about the thelist mailing list