Gossamer Forum
Home : General : Perl Programming :

CGI and graphics - need help

Quote Reply
CGI and graphics - need help
I'm working on a little metasearch script and i need to know how to display an image instead of the name of the search engine.

The code is this one:
_____________________________________________

@results = (@results,"Altavista|http://www.altavista.com|$accuracy|$title|$URL|$description");
_____________________________________________

Where it says "Altavista", there should be the link to the graphic like: http://www.myserver.com/images/altavista.gif

Does anyone knows how to do this ? Thanks!
Quote Reply
Re: CGI and graphics - need help In reply to
1) Create some image variables, like the following:

Code:
$altavista = 'img src="/path/to/altavista.gif" alt="Altavista"';

2) Then use the following codes in the sub where you are printing the results:

Code:
if ($data{'field'} eq 'Altavista') {
print qq|<$altavista>|;
}
else {
print qq|No Image|;
}

Replace field with the name of your field.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums