❶ 如何刪除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#}"