PHP带参数导航栏要怎么写
发布网友
发布时间:2022-05-14 09:00
我来回答
共3个回答
懂视网
时间:2022-05-14 13:21
<?php
$d_label=array("service"=>"有偿服务","teach"=>"家教中心","union"=>"校园服务联盟","job"=>"学生兼职","free"=>"信息库");
$directory=$REQUEST_URI;
while($directory!="/")
{
$d_text=basename($directory);
if(isset($d_label[$d_text])){$d_text=$d_label[$d_text];}
$d_link=$directory;
$d_curx="-><a href="$d_link">$d_text</a>";
$d_komplettx=$d_curx.$d_komplettx;
$directory=dirname($directory);
}
echo "栏目导航:".$d_komplettx;
?>
热心网友
时间:2022-05-14 10:29
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<!--页面关键词-->
<meta name="keywords" content="">
<!--页面描述-->
<meta name="description" content="">
<!--使用 viewport meta 标签在手机浏览器上控制布局-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/font-awesome.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<script src='js/bootstrap.min.js'></script>
<script src='js/parsley.min.js'></script>
<script src='js/common.js'></script>
<script src="js/jquery-latest.js"></script>
<!--jQuery更改class的值-->
<script>
switch (window.location.pathname) {
/* case"/":*/
case"/Index.php":
$("#topbar_Index").addClass("active");
break;
case"/Proct.php":
$("topbar_Proct").addClass("active");
break;
case"/Service.php":
$("topbar_Service").addClass("active");
break;
case"/About.php":
$("topbar_About").addClass("active");
break;
case"/Business.php":
$("topbar_Business").addClass("active");
break;
case"/Contact.php":
$("topbar_Contact").addClass("active");
break;
default :
break;
}
</script>
<script>
jQuery(window).scroll(function () {
var top = jQuery(document).scrollTop();
if (top > 30) {
jQuery('.main-menu').addClass('tiny');
} else {
jQuery('.main-menu').removeClass('tiny');
}
});
</script>
</head>
<body>
<!--导航开始 -->
<div class="navbar navbar-default navbar-fixed-top main-menu" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">菜单</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="Index.php" title="点击回到首页"><img src='images/blank.png'
alt="Website Design Du"></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class='' id="topbar_Index"><a href="Index.php">首 页</a></li>
<li class='' id="topbar_Proct"><a href="Proct.php">产 品</a></li>
<li class='' id="topbar_Service"><a href="Service.php">服 务</a></li>
<li class='' id="topbar_About"><a href="About.php">关于我们</a></li>
<li class='' id="topbar_Business"><a href="Business.php">加盟方式</a></li>
<li class='' id="topbar_Contact"><a href="Contact.php">联系</a></li>
</ul>
</div>
</div>
</div>
<!--导航结束 -->
热心网友
时间:2022-05-14 11:47
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>纯CSS菜单</title>
<style type="text/css">
* {font-family:"宋体";margin:0;padding:0;}
body {padding:15px;}
.nav li li a {display:inline-block;}
.nav li li a {display:block;}
.nav ul {list-style-type:none;margin:0;padding:0;}
.nav ul li { float:left;line-height:24px;display:block;border-bottom:dashed #ccc 1px;font-size:0;padding:0;margin:0;width:120px;}
.nav ul li a {display:block;width:120px;height:24px;font-size:12px;text-align:center;color:#555;text-decoration:none;background:#f7f7f7;}
.nav ul table {width:100%;border-collapse:collapse;border:0;padding:0;margin:0;}
.nav ul li ul {display:none;}
.nav ul li:hover,.nav ul li a:hover,.nav ul li a:active {color:red;background-color:#f1f1f1;}
.nav ul li:hover ul,.nav ul li a:hover ul,.nav ul li a:active ul {display:block;width:100%;}
.nav ul ul li {display:block;width:100%;border:none;}
.nav ul ul li a{display:block;color:blue;border:none;}
</style>
</head>
<body>
<div class="nav">
<ul>
<li><a href="#">首页
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">最新更新</a></li>
<li><a href="#">下载排行</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
<li><a href="#">ASP
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">企业整站</a></li>
<li><a href="#">图片相册</a></li>
<li><a href="#">社区程序</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
<li><a href="#">PHP
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">博客微博</a></li>
<li><a href="#">论坛社区</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
<li><a href="#">JSP
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">企业</a></li>
<li><a href="#">新闻系统</a></li>
<li><a href="#">留言</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
<li><a href="#">VC++
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">数据库</a></li>
<li><a href="#">界面</a></li>
<li><a href="#">加密</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
<li><a href="#">DELPHI
<!--[if IE 7]><!--></a><!--<![endif]--><table cellpadding="0" cellspacing="0"><tr><td>
<ul>
<li><a href="#">系统相关</a></li>
<li><a href="#">算法</a></li>
<li><a href="#">数据库</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
</ul>
</div>
</body>
</html>