班級成員留言簿管理: class/notebook/delnote.php
session_start();
if(!session_is_registered("superlogin"))//檢查是否註冊
{
echo "請重新進行管理員登陸
";
exit;
}
include ("../config.php");
if($del==1){ //判斷是否要刪除
mysql_query("delete from notebook where time='$time'",$db); //以留言時間為刪除標誌
echo "刪除成功!";
}
?>
刪除留言
$result = mysql_query("SELECT * FROM notebook",$db);
$row=mysql_num_rows($result);//查看結果有多少行
$max=$row; //文章總數
//設每頁顯示10篇,$p總頁數,$page第幾頁,$low 從第幾行開始讀,$x 讀取幾行
if (!$page){$page=1;}
$p=ceil($max/10);
$low=10*($page-1);
if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最後一頁,且不是10的整倍數,讀取$max除以10的餘數,否則取10
if($max==0){$x=0;}//如果沒有文章,$x取0
$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);
?>
首頁 > 留言簿 |
echo "文章總數: ",$max," 第"; for ($n=1;$n<=$p;$n++){ echo "$n "; } echo "頁"; ?> |
查看留言 |
for ($i=0;$i<=($x-1);$i++) { $user=mysql_result($result,$i,'user'); $time=mysql_result($result,$i,'time'); $ip=mysql_result($result,$i,'ip'); $title=mysql_result($result,$i,'title'); $nnote=mysql_result($result,$i,'nnote'); $yresult = mysql_query("SELECT * FROM user where user='$user'",$db);//讀取成員資料庫 $name=mysql_result($yresult,0,'name'); $signature=mysql_result($yresult,0,'signature');//讀取心情小語 $email=mysql_result($yresult,0,'email'); $face=mysql_result($yresult,0,'face'); $face='../image/face/icon'.$face; echo "
"; echo "
| | "; echo "
留言人:$name | "; echo "
發表於:$time | "; echo "
| "; echo "
$ip |
"; echo "
| 標題:$title |
"; echo "
| 留言內容:$nnote |
"; } mysql_close($db); ?> |
客人留言簿管理: class/notebookg/delnote.php
session_start();
if(!session_is_registered("superlogin"))//檢查是否註冊
{
echo "請重新進行管理員登陸
";
exit;
}
include ("../config.php");
if($del==1){ //判斷是否要刪除
mysql_query("delete from notebookg where time='$time'",$db); //以留言時間為刪除標誌
echo "刪除成功!";
}
?>
刪除留言
$result = mysql_query("SELECT * FROM notebookg ",$db);
$row=mysql_num_rows($result);//查看結果有多少行
$max=$row; //文章總數
//設每頁顯示10篇,$p總頁數,$page第幾頁,$low 從第幾行開始讀,$x 讀取幾行
if (!$page){$page=1;}
$p=ceil($max/10);
$low=10*($page-1);
if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最後一頁,且不是10的整倍數,讀取$max除以10的餘數,否則取10
if($max==0){$x=0;}//如果沒有文章,$x取0
$result = mysql_query("select * from notebookg ORDER BY time DESC limit $low,$x",$db);
?>
首頁 > 留言簿 |
echo "文章總數: ",$max," 第"; for ($n=1;$n<=$p;$n++){ echo "$n "; } echo "頁"; ?> |
查看留言 |
for ($i=0;$i<=($x-1);$i++) { $email=mysql_result($result,$i,'email'); $face=mysql_result($result,$i,'face'); $face='../image/face/icon'.$face; $name=mysql_result($result,$i,'name'); $time=mysql_result($result,$i,'time'); $ip=mysql_result($result,$i,'ip'); $title=mysql_result($result,$i,'title'); $nnote=mysql_result($result,$i,'nnote'); echo "
"; echo "
| | "; echo "
留言人:$name | "; echo "
發表於:$time | "; echo "
| "; echo "
$ip |
"; echo "
| 標題:$title |
"; echo "
| 留言內容:$nnote |
"; } mysql_close($db); ?> |
http://www.bkjia.com/PHPjc/316032.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/316032.htmlTechArticle班級成員留言簿管理: class/notebook/delnote.php ?php session_start(); if(!session_is_registered(superlogin))//檢查是否註冊 { echo a href='../../superadmin.php'請重新...