杏林同学录(九)


Posted in PHP onOctober 09, 2006

班级成员留言簿管理: class/notebook/delnote.php
<?php
session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "<a href='../../superadmin.php'>请重新进行管理员登陆<BR>";
exit;
}
include ("../config.php");
if($del==1){       //判断是否要删除
mysql_query("delete from notebook where time='$time'",$db); //以留言时间为删除标志
echo "删除成功!";
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>删除留言</TITLE>
<style type="text/css">
<!--
.blue9 {  font-size: 9pt; color: #0099FF; text-decoration: none}
.black9 {  font-size: 9pt; text-decoration: none}
.purple10 {  font-size: 10pt; color: #9900FF; text-decoration: none}
.white12 {  font-size: 12pt; color: #FFFFFF; text-decoration: none}
a:visited {  color: #FFFFFF}
a:link {  color: #FFFFFF}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
$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);
?>
<table width="98%" border="0" cellspacing="0" cellpadding="0" height="61">
  <tr>  
    <td height="62" width="34%"><img src="../image/classlogo.gif" width="224" height="60" border="0"></td>
    <td height="62" width="66%">  
      <div align="center"><img src="../image/note.gif" width="410" height="60"><img src="../image/y1.gif" width="60" height="60"></div>
    </td>
  </tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="0" height="253" bordercolordark="#FFFFFF" bordercolorlight="#003399" align="center">
  <tr>  
    <td height="250">
      <table width="95%" border="0" cellspacing="0" cellpadding="0" height="32" bgcolor="#3366FF">
        <tr>  
          <td width="28%" class="white12"><a href="../guest.php" class="white12">首页</a>  
            > <a href="index.php" class="white12">留言簿</a></td>
          <td width="56%" class="white12">  
            <?php
          echo "帖子总数:  ",$max,"   第";
          for ($n=1;$n<=$p;$n++){
          echo "<a href=index.php?page=$n>$n</a> ";
          }
          echo "页";
          ?>
          </td>
          <td width="16%"><a href="index.php" class="white12">查看留言</a></td>
        </tr>
      </table>  
<?php
   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 "<table width='100%' border='0' cellspacing='0' cellpadding='0' height=107' bordercolor='#FFFFFF'> <tr bgcolor='#eeeeee'>";  
echo "<td width='10%' height='33' bgcolor='#eeeeee' class='blue9'> <img src='$face.gif' width='32' height='32'></td>";
echo        "<td width='16%' height='33' bgcolor='#eeeeee' class='blue9'>留言人:$name</td>";
echo        "<td width='41%' height='33' bgcolor='#eeeeee' class='blue9'>发表于:$time</td>";
echo        "<td width='12%' height='33' bgcolor='#eeeeee' class='blue9'><a href='mailto:$email'><img src='../image/email.gif' width='16' height='16' border=0></a></td>";
echo        "<td width='21%' height='33' class='blue9'><img src='../image/ip.gif' width='13' height='15'>  $ip <a href='$PHP_SELF?del=1&time=$time'><img src='../image/del.gif' width='16' height='16' border=0></a></td>  </tr> <tr>";  
echo        "<td colspan='5' class='purple10' height='33'>标题:$title</td> </tr>";
echo        "<tr bgcolor='#ffffff'><td colspan='5' class='black9' height='37'>留言内容:$nnote</td></tr></table>";
}
mysql_close($db);
?>     
    </td>
</tr>
</table>
</BODY>
</HTML>
客人留言簿管理: class/notebookg/delnote.php
<?php
session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "<a href='../../superadmin.php'>请重新进行管理员登陆<BR>";
exit;
}
include ("../config.php");
if($del==1){       //判断是否要删除
mysql_query("delete from notebookg where time='$time'",$db); //以留言时间为删除标志
echo "删除成功!";
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>删除留言</TITLE>
<style type="text/css">
<!--
.blue9 {  font-size: 9pt; color: #0099FF; text-decoration: none}
.black9 {  font-size: 9pt; text-decoration: none}
.purple10 {  font-size: 10pt; color: #9900FF; text-decoration: none}
.white12 {  font-size: 12pt; color: #FFFFFF; text-decoration: none}
a:visited {  color: #FFFFFF}
a:link {  color: #FFFFFF}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
$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);
?>
<table width="98%" border="0" cellspacing="0" cellpadding="0" height="61">
  <tr>  
    <td height="62" width="34%"><img src="../image/classlogo.gif" width="224" height="60" border="0"></td>
    <td height="62" width="66%">  
      <div align="center"><img src="../image/note.gif" width="410" height="60"><img src="../image/y1.gif" width="60" height="60"></div>
    </td>
  </tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="0" height="253" bordercolordark="#FFFFFF" bordercolorlight="#003399" align="center">
  <tr>  
    <td height="250">
      <table width="95%" border="0" cellspacing="0" cellpadding="0" height="32" bgcolor="#3366FF">
        <tr>  
          <td width="28%" class="white12"><a href="../guest.php" class="white12">首页</a>  
            > <a href="index.php" class="white12">留言簿</a></td>
          <td width="56%" class="white12">  
            <?php
          echo "帖子总数:  ",$max,"   第";
          for ($n=1;$n<=$p;$n++){
          echo "<a href=index.php?page=$n>$n</a> ";
          }
          echo "页";
          ?>
          </td>
          <td width="16%"><a href="index.php" class="white12">查看留言</a></td>
        </tr>
      </table>  
<?php
   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 "<table width='100%' border='0' cellspacing='0' cellpadding='0' height=107' bordercolor='#FFFFFF'> <tr bgcolor='#eeeeee'>";  
echo "<td width='10%' height='33' bgcolor='#eeeeee' class='blue9'> <img src='$face.gif' width='32' height='32'></td>";
echo        "<td width='16%' height='33' bgcolor='#eeeeee' class='blue9'>留言人:$name</td>";
echo        "<td width='41%' height='33' bgcolor='#eeeeee' class='blue9'>发表于:$time</td>";
echo        "<td width='12%' height='33' bgcolor='#eeeeee' class='blue9'><a href='mailto:$email'><img src='../image/email.gif' width='16' height='16' border=0></a></td>";
echo        "<td width='21%' height='33' class='blue9'><img src='../image/ip.gif' width='13' height='15'>  $ip <a href='$PHP_SELF?del=1&time=$time'><img src='../image/del.gif' width='16' height='16' border=0></a></td>  </tr> <tr>";  
echo        "<td colspan='5' class='purple10' height='33'>标题:$title</td> </tr>";
echo        "<tr bgcolor='#ffffff'><td colspan='5' class='black9' height='37'>留言内容:$nnote</td></tr></table>";
}
mysql_close($db);
?>     
    </td>
</tr>
</table>
</BODY>
</HTML> 

PHP 相关文章推荐
深入PHP empty(),isset(),is_null()的实例测试详解
Jun 06 PHP
Smarty foreach控制循环次数的实现详解
Jul 03 PHP
php Imagick获取图片RGB颜色值
Jul 28 PHP
php中debug_backtrace、debug_print_backtrace和匿名函数用法实例
Dec 01 PHP
PHP中使用Imagick实现各种图片效果实例
Jan 21 PHP
php计算两个文件相对路径的方法
Mar 14 PHP
php实现html标签闭合检测与修复方法
Jul 09 PHP
分享PHP函数实现数字与文字分页代码
Jul 28 PHP
php编程中echo用逗号和用点号连接的区别
Mar 26 PHP
PHP数组函数知识汇总
May 12 PHP
如何判断php mysqli扩展类是否开启
Dec 24 PHP
PHP实现微信商户支付企业付款到零钱功能
Sep 30 PHP
我的论坛源代码(九)
Oct 09 #PHP
PHP个人网站架设连环讲(一)
Oct 09 #PHP
PHP个人网站架设连环讲(二)
Oct 09 #PHP
我的论坛源代码(七)
Oct 09 #PHP
我的论坛源代码(八)
Oct 09 #PHP
我的论坛源代码(十)
Oct 09 #PHP
杏林同学录(六)
Oct 09 #PHP
You might like
php获取qq用户昵称和在线状态(实例分析)
2013/10/27 PHP
php array_walk 对数组中的每个元素应用用户自定义函数详解
2016/11/18 PHP
在PHP中输出JS语句以及乱码问题的解决方案
2019/02/13 PHP
json 实例详细说明教程
2009/10/31 Javascript
不要在cookie中使用特殊字符的原因分析
2010/07/13 Javascript
jQuery学习笔记之jQuery选择器的使用
2010/12/22 Javascript
jquery验证表单中的单选与多选实例
2013/08/18 Javascript
javaScript 计算两个日期的天数相差(示例代码)
2013/12/27 Javascript
FF IE浏览器修改标签透明度的方法
2014/01/27 Javascript
使用jQuery动态加载js脚本文件的方法
2014/04/03 Javascript
常用的Javascript设计模式小结
2015/12/09 Javascript
JS代码防止SQL注入的方法(超简单)
2016/04/12 Javascript
简单几步实现返回顶部效果
2016/12/05 Javascript
JS中parseInt()和map()用法分析
2016/12/16 Javascript
Javascript实现倒计时时差效果
2017/05/18 Javascript
AngularJS日期格式化常见操作实例分析
2018/05/17 Javascript
es6函数之严格模式用法实例分析
2020/03/17 Javascript
JavaScript类的继承多种实现方法
2020/05/30 Javascript
[02:51]2014DOTA2 TI小组赛总结中国军团全部进军钥匙球馆
2014/07/15 DOTA
[05:31]DOTA2上海特级锦标赛主赛事第三日RECAP
2016/03/05 DOTA
[01:06]DOTA2亚洲邀请赛专属珍藏-荧煌之礼
2017/03/24 DOTA
python开发中module模块用法实例分析
2015/11/12 Python
Python结巴中文分词工具使用过程中遇到的问题及解决方法
2017/04/15 Python
Python实现矩阵转置的方法分析
2017/11/24 Python
Python实现合并两个列表的方法分析
2018/05/28 Python
python实现写数字文件名的递增保存文件方法
2018/10/25 Python
判断python对象是否可调用的三种方式及其区别详解
2019/01/31 Python
python计算阶乘和的方法(1!+2!+3!+...+n!)
2019/02/01 Python
Python 程序员必须掌握的日志记录
2020/08/17 Python
CSS3用@font-face实现自定义英文字体
2013/09/23 HTML / CSS
Christys’ Hats官网:英国帽子制造商
2018/11/28 全球购物
泰国的头号网上婴儿用品店:Motherhood.co.th
2019/04/09 全球购物
结婚通知短信怎么写
2015/04/17 职场文书
雷锋之歌观后感
2015/06/10 职场文书
投诉信范文
2015/07/02 职场文书
NodeJs使用webpack打包项目的方法详解
2022/02/28 NodeJs