LearningCoder Posted August 8, 2014 Share Posted August 8, 2014 Hey guys, I am currently working on re designing a right menu and I want to add pictures to show the weapons... This is the right menu up to now.[ATTACH=CONFIG]1600[/ATTACH] This is the protection bit <div align="center"><span class="playerstats"> Protection: </span> </span> <br> <span class="playerstats1"> <?php echo"$protection"; ?> <? if ($sprotection>=1){ ?> <i> <?php if($sprotection=="1"){ echo "<br>Light Military Vest"; }elseif($sprotection=="2"){ echo "<br>Medium Military Vest"; }else{ echo "<br>Heavy Military Vest"; }?> </i> <? } ?> </span> </div></td> And this is the gun bit,* <div align="center"><span class="playerstats"> Gun: </span> <br> <span class="playerstats1"> <?php echo"$gun"; ?> I need something like this attached below inserting into it. <tr> <td style="padding:2px;" width="100" height="100" class="item_cont" align="center"><img src=" <?php if($fetch->protection == "0"){ echo"/images/items/noprotection.png"; } elseif($fetch->protection == "Helmet"){ echo"/images/items/Helmet.png"; } elseif($fetch->protection == "StabVest"){ echo"/images/items/StabVest.png"; } elseif($fetch->protection == "RiotSheild"){ echo"/images/items/RiotSheild.png"; } elseif($fetch->protection == "Safehouse"){ echo"/images/items/Safehouse.png"; } elseif($fetch->protection == "ArmyBunker"){ echo"/images/items/ArmyBunker.png"; } elseif($fetch->protection == "BodyGuard"){ echo"/images/items/BodyGuard.png"; } ?> " width="100" height="100"></div></td> </tr> <tr> <td style="padding:2px;" width="90" class="item_cont" align="center"> <?php if($fetch->protection == "0"){ echo"No Protection"; }else{ echo"$fetch->protection"; } ?> <tr> Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 8, 2014 Share Posted August 8, 2014 I'm not too sure what you are asking for help on exactly but I believe you want those images to show up that's in your last section of code? You are echoing out the image path and what you need to do is add the img tags. Also instead of using all those nested if,else if, else statements you can use a switch statement which can make it a bit easier to read too for the future. Quote Link to comment Share on other sites More sharing options...
LearningCoder Posted August 8, 2014 Author Share Posted August 8, 2014 Yeah the images in the last section of the code I want to show up in the protection and gun code further up the page, and right I think I have an idea how to do it... Lets hope I dont mess it up! 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.