dongmiyi8220 2017-12-09 11:59
浏览 138
已采纳

登录后查看HTML内容

I have an index.php page. The user just connects to the page has a form to login. Once logged in, always display on the same page "Welcome User234, you are logged in. Logout?"

<?php if(isset($_SESSION['user_info']) && is_array($_SESSION['user_info'])) { ?>

    <form id="login-form" class="login-form" name="form1">

        <div id="form-content">
            <div class="welcome">
                <?php echo $_SESSION['user_info']['name']  ?>, you are logged in. 
                <br /><br />
                <?php echo $_SESSION['user_info']['content']  ?>
                <br /><br />
                <a href="index.php?ac=logout" style="color:#3ec038">Logout</a>
            </div>  
        </div>

    </form>

You can see here: http://demo.phpjabbers.com/freescripts/php-user-login/index.php (email: demo1@demo.com, password: pass)

Okay, now I want add my table (http://vulpinelab.online/TabellaExcel/) after the login of the User (each user will see a different table, for example user1 can view only /TabellaExcel, user2 can view only /TabellaExcel2..)

Is there a method to insert the table file in the index.php?

Or there is a method to make the page /TabellaExcel protected by the previous login for each user?

What is the best method and how canI do it?

  • 写回答

1条回答 默认 最新

  • dongshanji3102 2017-12-09 14:31
    关注

    You can make a tableID session variable which is extracted at the time of login from the database for each registered user in an auto_increment manner or however you prefer. According to that unique id variable, you can add the view of different tables for different users.

    Suppose, the tableID for user1 is '1', then he will see "/TabellaExcel1" or whatever and for user2 with tableID '2', he can view "/TabellaExcel".$_SESSION['tableID'] (which is 2) thus /TabellaExcel2.You can make use of this method and remember that it isn't necessary to use alternate integers as tableID, for protection they should be unique but random.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题