doufei2662 2017-09-24 06:52
浏览 28
已采纳

使HTML部分仅通过PHP对某些人可见

I've made a section in HTML, but I want to be visible only to people who are if($Admin >= 1) from my database.

But I don't know how to write it.

This is my HTML so far.

!-- ADM SECTION -->
  <div class="backimg" id="section-10">
    <div class="bghover wow fadeInUp" data-wow-duration="1.5s" data-wow-delay=".5s">
      <div class="grid flex16">
        <div class="row paddtop5">
          <h3 class="paraw wow fadeInUpBig" data-wow-duration="2s" data-wow-delay=".5s">ADMIN SECTION</h3>

                  <div class="admin">
<h3 data-wow-duration="2s" data-wow-delay=".5s"> Alege opțiunea </h3>
</div>


<!-- ban -->
<style>
ul.b {list-style-type: square;}</style>

<div class="ban"> 
<ul class="b">
  <li>BAN SYSTEM</li>
  <br>

  <li>KICK SYSTEM</li>
  <br>

  <li>ADMIN JAIL SYSTEM</li>
  <br>  
</ul>
</div>

<div class="ban2"> 
<ul class="b">
  <li>SEARCH SYSTEM</li>
  <br>

  <li>LOG SYSTEM</li>
  <br>

  <li>AWARD SYSTEM</li>
  <br>  
</ul>
</div>

<div class="ban3"> 
<ul class="b">
  <li>MANAGAMENT SYSTEM</li>
  <br>

  <li>UNBAN SYSTEM</li>
  <br>

  <li>UNJAIL SYSTEM</li>
  <br>  
</ul>
</div>

Shall I add if($Admin >= 1) echo ? I want to show nothing to who has $admin lower than 1. And who has higher or equal than 1, to show that HTML part.

展开全部

  • 写回答

5条回答 默认 最新

  • dtm41506 2017-09-24 06:55
    关注
    <?php if($Admin >= 1) { ?>
    <!-- ADM SECTION -->
    
    
     <div class="backimg" id="section-10">
        <div class="bghover wow fadeInUp" data-wow-duration="1.5s" data-wow-delay=".5s">
          <div class="grid flex16">
            <div class="row paddtop5">
              <h3 class="paraw wow fadeInUpBig" data-wow-duration="2s" data-wow-delay=".5s">ADMIN SECTION</h3>
    
                      <div class="admin">
    <h3 data-wow-duration="2s" data-wow-delay=".5s"> Alege opțiunea </h3>
    </div>
    
    
    <!-- ban -->
    <style>
    ul.b {list-style-type: square;}</style>
    
    <div class="ban"> 
    <ul class="b">
      <li>BAN SYSTEM</li>
      <br>
    
      <li>KICK SYSTEM</li>
      <br>
    
      <li>ADMIN JAIL SYSTEM</li>
      <br>  
    </ul>
    </div>
    
    <div class="ban2"> 
    <ul class="b">
      <li>SEARCH SYSTEM</li>
      <br>
    
      <li>LOG SYSTEM</li>
      <br>
    
      <li>AWARD SYSTEM</li>
      <br>  
    </ul>
    </div>
    
    <div class="ban3"> 
    <ul class="b">
      <li>MANAGAMENT SYSTEM</li>
      <br>
    
      <li>UNBAN SYSTEM</li>
      <br>
    
      <li>UNJAIL SYSTEM</li>
      <br>  
    </ul>
    </div>
    <?php } ?>
    

    展开全部

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部