display image in stead of text

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
stampertje
Forum Newbie
Posts: 1
Joined: Mon Oct 06, 2008 11:18 am

display image in stead of text

Post by stampertje »

i am quite new to PHP so maybe this may sound like a stupid question, but i'll ggive it a try anyway.

on my site users can submit events via a form. these events should be listed in a table. in stead of displaying the country name, i would like to display the flag of each country in the column country. could anyone tell me how to do this?

i think it would be possible to do it this way, but there are many countries :?

Code: Select all

if (entry="BE") echo '<img src="link naar de afbeelding">'
thanks for your help
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: display image in stead of text

Post by onion2k »

Give your images names like BE.gif, then use something like ...

Code: Select all

echo "<img src=\"$entry.gif\">";
Post Reply