dongmei9203 2015-07-21 15: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 15: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条)

报告相同问题?

悬赏问题

  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统