Leveecius Posted November 1, 2009 Share Posted November 1, 2009 Hey guys, right now I'm trying to make it so that on my game where it shows your ranks, it will show your ranks by your user level in the game (moderator, administrator, ect). So, I've been trying and here is what I've got and I'm not so so sure if it's right or not: <tr> <td width="150" height="18" bgcolor="#000066" class="menu_header2"><div align="center"><span class="style1"><strong>.::</strong>Rank<strong>::.</strong></span></div></td> </tr> <? if ($userlevel=1) echo' <td bgcolor="#333333"><div align="center"><? echo $rows['rank'];</td>' ?> <br> if ($userlevel >=2) echo' <td bgcolor="#333333"><div align="center"><? echo $rows['rank2'];<td>' ?> <br> <br> <br> </div></td> </tr> Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted November 1, 2009 Share Posted November 1, 2009 close it's double equals and you need opening and closing braces and instead of closing the php you just need to concatenate and your quotes needed to be redon. <tr> <td width="150" height="18" bgcolor="#000066" class="menu_header2"><div align="center"><span class="style1"><strong>.::</strong>Rank<strong>::.</strong></span></div></td> </tr> <? if ($userlevel==1) { echo "<td bgcolor='#333333'><div align='center'>".$rows['rank']."</td><br>"; } if ($userlevel >=2) { echo "<td bgcolor='#333333'><div align='center'>".$rows['rank2']."<td><br>"; } ?> <br> <br> </div></td> </tr> Quote Link to comment Share on other sites More sharing options...
Jnerocorp Posted November 1, 2009 Share Posted November 1, 2009 Try this: <tr> <td width="150" height="18" bgcolor="#000066" class="menu_header2"><div align="center"><span class="style1"><strong>.::</strong>Rank<strong>::.</strong></span></div></td> </tr> <?php if($userlevel == 1) { $rank1 = $rows['rank']; ?> <td bgcolor="#333333"><div align="center"><?php echo $rank1; ?></td> <br> <?php } if ($userlevel >= 2) { $rank2 = $rows['rank2']; ?> <td bgcolor="#333333"><div align="center"><?php echo $rank2; ?><td> <br> <?php } ?> <br> <br> </div></td> </tr> 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.