Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

[solved]elseif problams.

Recommended Posts

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]
<?php

if($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]

Share this post


Link to post
Share on other sites
"=" assigns, "==" compares. You should know that by now.

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites
sorry for that solved typo.

sorry i was assigning both conditions didnt see it cheers.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.