杏林同学录(九)


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 相关文章推荐
PHP4与PHP5的时间格式问题
Feb 17 PHP
在PHP中实现Javascript的escape()函数代码
Aug 08 PHP
使ecshop模板中可引用常量的实现方法
Jun 02 PHP
php 对输入信息的进行安全过滤的函数代码
Jun 29 PHP
php 操作调试的方法
Jul 12 PHP
PHP在不同页面间传递Json数据示例代码
Jun 08 PHP
PHP生成数组再传给js的方法
Aug 07 PHP
php中多维数组按指定value排序的实现代码
Aug 19 PHP
phpcms手机内容页面添加上一篇和下一篇
Jun 05 PHP
PHP的数组中提高元素查找与元素去重的效率的技巧解析
Mar 03 PHP
老生常谈PHP 文件写入和读取(必看篇)
May 22 PHP
PHP实现笛卡尔积算法的实例讲解
Dec 22 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防止注入攻击实例分析
2014/11/03 PHP
PHP实现的数独求解问题示例
2017/04/18 PHP
PHP排序二叉树基本功能实现方法示例
2018/05/26 PHP
thinkPHP5框架auth权限控制类与用法示例
2018/06/12 PHP
PHP字符串与数组处理函数用法小结
2020/01/07 PHP
JavaScript的类型转换(字符转数字 数字转字符)
2010/08/30 Javascript
js中格式化日期时间型数据函数代码
2010/11/08 Javascript
JQuery制作的放大效果的popup对话框(未添加任何jquery plugin)分享
2013/04/28 Javascript
JavaScript数值转换的三种方式总结
2014/07/31 Javascript
jquery实现炫酷的叠加层自动切换特效
2015/02/01 Javascript
使用javaScript动态加载Js文件和Css文件
2015/10/24 Javascript
jQuery Ajax 实例代码 ($.ajax、$.post、$.get)
2016/04/29 Javascript
浅析jQuery中使用$所引发的问题
2016/05/29 Javascript
基于jQuery实现歌词滚动版音乐播放器的代码
2016/09/17 Javascript
JavaScript 闭包详细介绍
2016/09/28 Javascript
自学实现angularjs依赖注入
2016/12/20 Javascript
完美解决浏览器跨域的几种方法(汇总)
2017/05/08 Javascript
node.js调用C++函数的方法示例
2018/09/21 Javascript
基于React Native 0.52实现轮播图效果
2020/08/25 Javascript
分享一款超好用的JavaScript 打包压缩工具
2020/04/26 Javascript
[01:27:30]LGD vs Newbee 2019国际邀请赛小组赛 BO2 第二场 8.16
2019/08/19 DOTA
python中的插值 scipy-interp的实现代码
2018/07/23 Python
对python多线程中Lock()与RLock()锁详解
2019/01/11 Python
python实现复制大量文件功能
2019/08/31 Python
Python try except异常捕获机制原理解析
2020/04/18 Python
Pycharm安装并配置jupyter notebook的实现
2020/05/18 Python
Python读取多列数据以及用matplotlib制作图表方法实例
2020/09/23 Python
医疗保健专业人士购物网站:Scrubs & Beyond
2017/02/08 全球购物
Linux面试题LINUX系统类
2014/11/19 面试题
《海底世界》教学反思
2014/04/16 职场文书
医师定期考核实施方案
2014/05/07 职场文书
小学生美德少年事迹材料
2014/08/24 职场文书
教师群众路线学习心得体会
2014/11/04 职场文书
2015年暑期社会实践活动总结
2015/03/27 职场文书
2019年最新感恩节祝福语(28句)
2019/11/27 职场文书
python基础之模块的导入
2021/10/24 Python