❶ 如何删除php源码中的导航栏分类 就是网站首页顶部都有分类项 有些我不想要了 在pup源码中如何修改
打开php文件 <a href="">积分购买</a> 这个删除了就行了
❷ 怎样用PHP来给网页做导航栏
本文只需要读者具备PHP、HTML的初步知识就可以基本读懂了。 译文:如大家所知PHP对于用数据库驱动的网站(making database-driven sites)来讲可谓功能强大,可是我们是否可以用它来做点其他事情呢?PHP给了我们所有我们期望的工具:for与while的循环结构、数学运算等等,还可以通过两种方式来引用文件:直接引用或向服务器提出申请。其实何止这些,让我们来看一个如何用它来做导航条的例子:完整的原代码:<!—— This "<?" is how you indicate the start of a block of PHP code, ——> <?PHP # and this "#" makes this a PHP comment. $full_path = getenv("REQUEST_URI"); $root = dirname($full_path);$page_file = basename($full_path);$page_num = substr($page_file, strrpos($page_file, "_") + 1, strpos($page_file, ".html") - (strrpos($page_file, "_") + 1)); $partial_path = substr($page_file, 0, strrpos($page_file, "_")); $prev_page_file = $partial_path . "_" . (string)($page_num-1) . ".html";$next_page_file = $partial_path . "_" . (string)($page_num+1) . ".html"; $prev_exists = file_exists($prev_page_file);$next_exists = file_exists($next_page_file); if ($prev_exists) { print "<a href="$root/$prev_page_file">previous</a>";if ($next_exists) { print " | ";} if ($next_exists) { print "<a href="$root/$next_page_file">next</a>";} ?>//原程序完。 代码分析:OK! 前面做了足够的铺垫工作,现在让我们来看看如何来用PHP来完成这项工作: <!—— This "<?" is how you indicate the start of a block of PHP code, ——> <?PHP # and this "#" makes this a PHP comment. $full_path = getenv("REQUEST_URI"); $root = dirname($full_path);$page_file = basename($full_path); /* PHP函数getenv()用来取得环境变量的值,REQUEST_URI的值是紧跟在主机名后的部分URL,假如URL是, 那它的值就为/dinner/tuna_1.html. 现在我们将得到的那部分URL放在变量$full_path中,再用dirname()函数来从URL中抓取文件目录,用basename()函数取得文件名,用上面的例子来讲dirname()返回值:/dinner/;basename()返回:tuna_1.html.接下来的部分相对有些技巧,假如我们的文件名以story_x的格式命名,其中x代表页码,我们需要从中将我们使用的页码抽出来。当然文件名不一定只有一位数字的模式或只有一个下划线,它可以是tuna_2.html,同样它还可以叫做tuna_234.html甚至是candy_apple_3.html,而我们真正想要的就是位于最后一个“_”和“。html”之间的东东。可采用如下方法:*/ $page_num = substr($page_file, strrpos($page_file, "_") + 1, strpos($page_file, ".html") - (strrpos($page_file, "_") + 1));/* substr($string, $start,[$length] )函数给了我们字符串$string中从$start开始、长为$length或到末尾的字串(方括号中的参数是可选项,如果省略$length,substr就会返回给我们从$start开始直到字符串末尾的字符串),正如每一个优秀的C程序员告诉你的那样,代表字符串开始的位置开始的数字是“0”而不是“1”。 函数strrpos($string, $what)告诉我们字符串$what在变量$string中最后一次出现的位置,我们可以通过它找出文件名中最后一个下划线的位置在哪,同理,接着的strpos($string, $what)告诉我们“。html”首次出现的位置。我们通过运用这三个函数取得在最后一个“_”和“。html”之间的数字(代码中的strpos()+1代表越过“_”自己)。 剩下的部分很简单,首先为上页和下页构造文件名:*/ $partial_path = substr($page_file, 0, strrpos($page_file, "_")); $prev_page_file = $partial_path . "_" . (string)($page_num-1) . ".html";$next_page_file = $partial_path . "_" . (string)($page_num+1) . ".html"; /*(string)($page_num+1)将数学运算$page_num+1的结果转化为字符串类型,这样就可以用来与其他字串最终连接成为我们需要的文件名。 */ /*现在检查文件是否存在(这段代码假设所有的文件都位于同样的目录下),并最终给出构成页面导航栏的HTML代码。>
❸ 从网上找了个弹性菜单的PHP源码,不知道如何修改宽度如何另下面的弹性菜单宽度与上面的导航栏一致
找到width这个 ,逐个试,你能找到的
没代码我怎么给你说啊
❹ php如何实现二级导航菜单
php 数据库设计
id title url pid leve
1 一级菜单 index.php 0 1
2 二级菜单 list.php 2 2
这种格式的 可以无限级分类
取数据的时候 按level 取 几级就是几级 ,
循环的话 就是先 循环 level=1的分类,然后再循环里面套小循环
这是最基本的方法
还有一种就是
自定义函数 生成tree 树形结构 最后用css, js美化加特效
❺ 谁有详细php 下拉菜单代码
这是我自己用的一段代码,你自己改一下,点一下一级文本框,它所属的文本框会收起或伸展。
<SCRIPT language=javascript>
<!--
function menu_tree(meval)
{
var left_n=eval(meval);
if (left_n.style.display=="none")
{ eval(meval+".style.display='';"); }
else
{ eval(meval+".style.display='none';"); }
}
-->
</SCRIPT>
<TABLE class=navi cellSpacing=1 align=center border=0>
<TBODY>
<TR>
<TH>后台 >> 新闻分类</TH></TR></TBODY></TABLE><BR>
<table border=0 cellspacing=1 align=center class=form>
<tr>
<th colspan="2">添加分类</th>
</tr>
<form action="" method="post">
<tr>
<td colspan="2" align="center" height='30'>
<select name="fid">
<option value="0">添加大类</option>
<?php
$query=$db->findall("shipin where fid=0");
while ($row=$db->fetch_array($query)){
$new_class_arr[$row[id]]=$row[name];
echo "<option value=\"$row[id]\">$row[name]</option>";
}
?>
</select>
<input type="text" name="name" value="">
<input type="submit" name="into_class" value="添加分类"/>
</td>
</form>
</tr>
</table>
<br>
<table border=0 cellspacing=1 align=center class=form>
<tr>
<th colspan="2">系统分类</th>
</tr>
<?php
foreach ($new_class_arr as $id=>$val){
?>
<tr>
<td onClick ="javascript:menu_tree('left<?=$id ?>');" >
<form action="" method="post">
<IMG src="images/menu.gif" align=absMiddle border=0>
<input type="hidden" name="id" value="<?php echo $id?>">
<input type="text" name="name" value="<?php echo $val?>">
<input type="submit" name="update_class" value="更新"/>
<input type="button" value="删除" onclick="location.href='?del=<?php echo $id?>'"/>
</form>
</td>
</tr>
<tr id=left<?=$id ?>>
<td>
<table >
<tbody>
<?php
$query_fid=$db->findall("shipin where fid=$id");
while ($row_fid=$db->fetch_array($query_fid)){
?>
<tr>
<td>
<form action="" method="post">
<IMG src="images/menu.gif" align=absMiddle border=0>
<input type="hidden" name="id" value="<?php echo $row_fid[id]?>">
<input type="text" name="name" value="<?php echo $row_fid[name]?>">
<input type="submit" name="update_class" value="更新"/>
<input type="button" value="删除" onclick="location.href='?del=<?php echo $row_fid[id]?>'"/>
</form>
</td></tr>
<?php }?>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</table>
</BODY></HTML>
❻ 怎样用PHP来给网页做导航栏
/*(string)($page_num+1)将数学运算$page_num+1的结果转化为字符串类型,这样就可以用来与其他字串最终连接成为我们需要的文件名。
*//*现在检查文件是否存在(这段代码假设所有的文件都位于同样的目录下),并最终给出构成页面导航栏的HTML代码。
*/$prev_exists=file_exists($prev_page_file);$next_exists=file_exists($next_page_file);
if($prev_exists)
{print"<a$root/$prev_page_file">previous</a>";if($next_exists)
{print"|";}if($next_exists)
{print"<a$root/$next_page_file">next</a>";}
?>
❼ 如何删除php源码中的导航栏分类 就是网站首页顶部都有分类项 有些我不想要了 在pup源码中如何修改
这个一般后台就可以删掉,后台不行就在源码里面找相关关键字看看。如果需要更多精品网站源码或者网店模板可以去15度分享网~~~祝你成功~!~~~
❽ php网站后台菜单栏是怎样做的
从导航栏的HTML代码来看,应该是iframe布局的后台,点击url,在name="menu"这个iframe下加载页面,然后onclick="Tabmenu(this.4)"应该是切换左侧栏的HTML,不同的栏目,对应不同的左侧栏。
❾ PHP网站导航源码修改
从 {#RP#} 这种形式来看,貌似是使用了类似了模板的技术。
既然是模板,也就是说,你需要修改提供的源数据就可以了。
href="{#RP#}huanzeng/class/
href="{#RP#}"