Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 21st, 2005, 9:50 PM   #1
foxcity911
Programmer
 
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0 foxcity911 is on a distinguished road
Multiple IF statements, perhaps?

Hi, what ive done is made a football points table using PHP, that works out games played, percentages, point differences, etc. that is all done properly but now I want to add pictures etc.
I have a drop box with all the team names (Lions, Crows…) that posts to the next page of the currently 2 page program. The team names ($teams on page 2) parse thru and whatever team was selected is printed. What I want is the corresponding team logos to print depending on what team was selected in the drop box (16 teams). The code I originally tried (but obviously didn’t work) was:

 if ($team = "Adelaide Crows") {
print ("<TR><TD>
<IMG SRC='teams\crows.gif'></TD></TR>");

elseif ($team = "Brisbane Lions") {
print ("<TR><TD>
<IMG SRC='teams\lions.gif'></TD></TR>");
}

what happens when I run this is no matter what team I select whether it be lions, crows or another team, it prints the Crows logo, even though it prints the correct team name. What can I do to get around this? Do I need to use multiple if statements? The solution would be greatly appreciated.
foxcity911 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC