Jump to content
MakeWebGames

Need help on my right menu


LearningCoder

Recommended Posts

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>

rightmenu.png.662b234419a1e9ed4721ee23edcbc004.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...