杏林同學錄(九)_PHP教程

來源:互聯網
上載者:User
班級成員留言簿管理: 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 " "; echo " "; echo " "; echo " "; echo " "; echo "
留言人:$name發表於:$time $ip
標題:$title
留言內容:$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 " "; echo " "; echo " "; echo " "; echo " "; echo "
留言人:$name發表於:$time $ip
標題:$title
留言內容:$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'請重新...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.