dongmei9203 2015-07-21 07:33
浏览 88
已采纳

如何包含基于导航栏的php文件

Hey guys Id like to know what should I put in my href to include files from my class folder.

My site folder structure

folder-class-head.php
            -home.php
            -setting.php
            -footer.php
      -index.php

This is my head.php look like. What should I fill in the href in order to include the the file in my class folder?

<html>
 <head></head>
 <body>
   <a href="">Home</a> <a href="">Setting</a>

my index.php is that the right way to do if statement?

<?
include "class/head.php";
    <--body start-->
   if (do= home.php){
include "class/home.php";
}

if (do= setting.php){

    include "class/setting.php";
}
<--body end -->
<--footer area-->
include "class/footer.php";
?>
  • 写回答

2条回答 默认 最新

  • doutou1922 2015-07-21 07:41
    关注

    you can add like , &page=home to the href, and check if it is home page,

    if($_GET['page']=='home')
    {
    include "class/home.php";
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

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

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

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

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

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

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

客服 返回
顶部