班级成员留言簿管理: 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);
?>
|
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 "
} mysql_close($db); ?> |
|
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 "
} mysql_close($db); ?> http://www.bkjia.com/PHPjc/316032.html www.bkjia.com
Previous article:PHP4 Practical Application Experience (8)_PHP Tutorial
Next article:PHP4 Practical Application Experience (9)_PHP Tutorial
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
PHP mail sends empty email
I'm similar to php and don't understand where the problem lies. Sometimes the php function...
From 2024-03-31 15:44:07
0
1
338
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|