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] Quote Link to comment 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. Quote Link to comment 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". Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.