dongyi1748 2016-03-29 11:27
浏览 44

引用特定内部php的链接

I am a newbie exploring php , kindly pardon me if i look silly also since i exactly don't know how to title this, i titled what i felt to be relative .

I have a login form which have inputs email,password and usertype dropdown

Based on usertype selected, table will be selected in db

Logged in user will be redirected to account.php which looks like below

<?php require_once("header.php"); ?>
<?php require_once("top_bar.php"); ?>
<?php require_once("left_side_nav.php"); ?>
<!-- MAIN CONTENTS START -->
<?php 
if(isset($_SESSION['login_type']) && $_SESSION['login_type'] = 'admin')
{
require_once("a_inner_dash.php"); 
}
else if(isset($_SESSION['login_type']) && $_SESSION['login_type'] = 'user')
{
require_once("u_inner_dash.php"); 
}   
else if(isset($_SESSION['login_type']) && $_SESSION['login_type'] = 'accountant')
{
require_once("ac_inner_dash.php"); 
}   
?> 
<!-- MAIN CONTENTS END -->
<?php require_once("footer.php"); ?> 

The file "left_side_nav.php" is as below

<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu">
    <li class="header">MAIN NAVIGATION</li>

        <li>
          <a href="account.php">
            <i class="fa fa-dashboard"></i> <span>Account</span>
          </a>
        </li>
         <li>
          <a href="#">
            <i class="fa fa-male"></i> <span>Menu1</span>
          </a>
        </li>
        <li>
          <a href="#">
            <i class="fa fa-child"></i> <span>Menu2</span>
          </a>
        </li>
        <li>
          <a href="#">
            <i class="fa fa-group"></i> <span>Menu3</span>
          </a>
        </li>
       </ul>
</section>
    <!-- /.sidebar -->
</aside>

Now my issue is, When i logged in as admin and i click a menu item for instance Menu1 the result should be on "a_inner_dash.php" and if i logged in as User and click on menu item the result should be on "u_inner_dash.php" and as you see in account.php it's just a part in a webpage

i tried and couldn't sort out a way . Kindly help me please

Note : The logged in user type is correctly been detected and the correct main content URL is been loaded. The issue is i don't know how to reference the menu from navbar to here which is a part of webpage

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
    • ¥20 测距传感器数据手册i2c
    • ¥15 RPA正常跑,cmd输入cookies跑不出来