redarrow Posted August 20, 2006 Share Posted August 20, 2006 for some reason the code is not doing what it's suppose to.i can get the first image but not the rest please help.it's like the elseif dosent seem to work.[code]<?phpif($programming_lanuage="html"){$picture="html.png";}elseif($programming_lanuage="php"){$picture="php.png";}elseif($programming_lanuage="mysql"){$picture="mysql.png";}elseif($programming_lanuage="asp"){$picture="asp.png";}elseif($programming_lanuage="javascript"){$picture="javascript.png";}elseif($programming_lanuage="java"){$picture="java.png";}elseif($programming_lanuage="cgi"){$picture="cgi.png";}elseif($programming_lanuage="c++"){$picture="c.png";}elseif($programming_lanuage="css"){$picture="css.png";}elseif($programming_lanuage="python"){$picture="python.png";}elseif($programming_lanuage="delphi"){$picture="delphi.png";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/18125-solvedelseif-problams/ Share on other sites More sharing options...
448191 Posted August 20, 2006 Share Posted August 20, 2006 "=" assigns, "==" compares. You should know that by now. Link to comment https://forums.phpfreaks.com/topic/18125-solvedelseif-problams/#findComment-77693 Share on other sites More sharing options...
hitman6003 Posted August 20, 2006 Share Posted August 20, 2006 Use "==" instead of "=".= is an assignment operator, == is a comparison operator. So when your script executes, the first if statement makes $programming_lanuage equal to "html". Link to comment https://forums.phpfreaks.com/topic/18125-solvedelseif-problams/#findComment-77694 Share on other sites More sharing options...
redarrow Posted August 20, 2006 Author Share Posted August 20, 2006 i do no that but it didnt work 1 min. Link to comment https://forums.phpfreaks.com/topic/18125-solvedelseif-problams/#findComment-77695 Share on other sites More sharing options...
redarrow Posted August 20, 2006 Author Share Posted August 20, 2006 sorry for that solved typo.sorry i was assigning both conditions didnt see it cheers. Link to comment https://forums.phpfreaks.com/topic/18125-solvedelseif-problams/#findComment-77699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.