基于mysql的论坛(5)


Posted in PHP onOctober 09, 2006

## manage_read.php
<?php
require ("func.php");
if (check_admin_password()) {
    $board=$jl_forum[board];
    switch ($job){
        case "setgood":
            set_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "setnogood":
            set_no_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "delete":
            del_doc($jl_forum[board],$uid);
            $work=1;
            break;
    }
if (!$word) {
    add_one_hit($board,$id);
}
$sql="select * from $board where id=$id";
$sql_result=mysql_query($sql);
$sum=mysql_num_rows($sql_result);
$sql_row=mysql_fetch_array($sql_result);
$title=$sql_row[title];
$writer=$sql_row[writer];
$cont=$sql_row[cont];
$writetime=$sql_row[writetime];
$hits=$sql_row[hits];
$good=$sql_row[good];
$rootid=$sql_row[id];
$fromip=$sql_row[fromip];
$sql="select * from $board where slaveid=$id";
$sql_result=mysql_query($sql);
if ($sum<>0) {
?>
<html>
<head>
<title><?php echo $title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script language="javascript">
function sendmsg(name){                window.open("sendmsg.php?name="+name,"","height=200,width=500,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>

</head>

<body bgcolor="#666699">
<?php include "ad.php";?><br>
<hr noshade width="98%" size="1">
<table width="98%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr bgcolor="#666666">
    <td><font color="#FFcc00"><b>标题:<?php echo $title;?> <font color="#FFFFCC">◎操作:</font></b></font><b><?php echo "<a href="$php_self?job=setgood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转进精华区</font></a></b><font color="#FFcc00"><b> </b></font><b><?php echo "<a href="$php_self?job=delete&uid=$id&id=$rootid">";?><font color="#FFFFFF">删除</font></a></b><font color="#FFcc00"><b><?php
if ($good=="y"){
?> </b></font><b><?php echo "<a href="$php_self?job=setnogood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转出精华区</font></a></b><font color="#FFcc00"><b>  
      <?php
}
?> </b></font></td>
  </tr>
  <tr>
    <td bgcolor="#eeeeee">作者:<?php echo "$writer";?>(<?php echo $writetime;?>,点击:<?php echo $hits;?>) <a href="javascript:sendmsg('<?php echo "$writer";?>')"><img src="image/icon1.gif" width="18" height="17" alt="给作者留言" border="0"></a> <a href="userinfo.php?name=<?php echo $writer;?>"><img src="image/profile.gif" width="16" height="16" alt="察看用户资料" border="0"></a></td>
  </tr>
  <tr>
    <td bgcolor="#ffffef"><?php echo $cont;?></td>
  </tr>
  <tr bgcolor="#e8eee0">
    <td>※ 来源:<?php echo $jl_forum[chinesename];?> [◆FROM:<?php echo $fromip;?>]</td>
  </tr>
</table>
<br>
<?php
if (!$add){
while($sql_row=mysql_fetch_array($sql_result)) {
$good=$sql_row[good];
?>
<table width="98%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr bgcolor="#015C71">
    <td><font color="#ffffff">标题:<?php echo $sql_row[title];
    $id=$sql_row[id];
    ?> <font color="#FFFFCC">◎操作:</font></b></font><b><?php echo "<a href="$php_self?job=setgood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转进精华区</font></a></b><font color="#FFcc00"><b> </b></font><b><?php echo "<a href="$php_self?job=delete&uid=$id&id=$rootid">";?><font color="#FFFFFF">删除</font></a></b><font color="#FFcc00"><b><?php
if ($good=="y"){
?> </b></font><b><?php echo "<a href="$php_self?job=setnogood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转出精华区</font></a></b><font color="#FFcc00"><b>  
      <?php
}
?> </b></font></td>
  </tr>
  <tr bgcolor="#eeeeee">
    <td>作者:<?php echo "$sql_row[writer]";?>(<?php echo $sql_row[writetime];?>) <a href="javascript:sendmsg('<?php echo "$sql_row[writer]";?>')"><img src="image/icon1.gif" width="18" height="17" alt="给作者留言" border="0"></a> <a href="userinfo.php?name=<?php echo "$sql_row[writer]";?>"><img src="image/profile.gif" width="17" height="16" alt="察看用户资料" border="0"></a></td>
  </tr>
  <tr>
    <td bgcolor="#ffffef"><?php echo $sql_row[cont];?></td>
  </tr>
  <tr bgcolor="#e8eee0">
    <td>※ 来源:<?php echo $jl_forum[chinesename];?> [◆FROM:<?php echo $sql_row[fromip];?>]</td>
  </tr>
</table>
<?php
}
}
?> <br>
<?php include"footer.php";?><br>
</body>
</html>
<?php
}
else {
    echo "此条纪录已经被删除";
}
}
else {
    show_error(1);
}
?>
## modify.php
<?php
require "func.php";
if (check_user_password($jl_forum[name],$jl_forum[password])) {
$name=$jl_forum[name];
$password=$jl_forum[password];
$sql="select * from user where name='$name'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
?>
<html>
<head>
<title>修改资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body bgcolor="#FFFFFF" background="image/bg.gif">
<?php include "header.php";?><br>
<hr noshade width="97%" size="1">
<div align="center">修改用户个人资料<br>
  <table width="90%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#336699" bordercolordark="#FFFFFF">
    <tr valign="top">  
      <td colspan="2">  </td>
    </tr>
    <tr>  
      <td colspan="2">  
        <form method="post" action="change.php">
          <table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
            <tr>  
              <td align="right">用户名</td>
              <td><?php echo $name;?></td>
            </tr>
            <tr>  
              <td align="right">密码</td>
              <td>  
                <input type="password" name="pwd1" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9" value="<?php echo $password;?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">重复密码</td>
              <td>  
                <input type="password" name="pwd2" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9" value="<?php echo $password;?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">Email</td>
              <td>  
                <input type="text" name="email" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[email];?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">性别</td>
              <td>  
                <select name="sex">
                  <option value="秘密" selected>秘密</option>
                  <option value="男">男</option>
                  <option value="女">女</option>
                </select>
              </td>
            </tr>
            <tr>  
              <td align="right">真实性名</td>
              <td>  
                <input type="text" name="realname" size="17" maxlength="16" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[realname];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">地址</td>
              <td>  
                <input type="text" name="address" maxlength="40" size="30" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[address];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">电话</td>
              <td>  
                <input type="text" name="phone" size="22" maxlength="20" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[phone];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">主页</td>
              <td>  
                <input type="text" name="homepage" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="50" value="<?php echo $sql_row[homepage];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">OICQ</td>
              <td>  
                <input type="text" name="oicq" maxlength="11" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="12" value="<?php echo $sql_row[oicq];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">签名</td>
              <td><?php echo "$sql_row[qm]<br>";?>  
                <textarea name="qm" wrap="VIRTUAL" cols="50"></textarea>
              </td>
            </tr>
            <tr>  
              <td align="right">  </td>
              <td align="center">  
                <input type="submit" name="b2" value="修改">
                <input type="reset" name="Submit2" value="清除" >
              </td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
  <div align="center"><br>
  </div>
</div>
<?php include "footer.php";?>
</body>
</html>
<?php
}
else {
    show_error(4);
}
?>
## modify_l.php
<?php
require "func.php";
if ($b1) {
    if (is_user_exits($name) and check_user_password($name,$password)) {
    setcookie ("jl_forum[name]",$name);
    setcookie ("jl_forum[password]",$password);
    redirect2("modify.php");
    }
    else {
        show_error(4);
    }
}
else {
?>
<html>
<head>
<title>main</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/page.css">
</head>

<body bgcolor="#FFFFFF" background="image/bg.gif">
<table width="90%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#FFCC99" bordercolordark="#FFCC99">
  <tr bgcolor="#CCFF99">  
    <td>
      <div align="center"><b>修改资料登陆</b></div>
    </td>
  </tr>
  <tr align="center">  
    <td>
      <form method="post" action="modify_l.php">
        <table width="70%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="38%" align="right">用户名:</td>
            <td width="62%" align="left">
              <input type="text" name="name" size="17" maxlength="16">
            </td>
          </tr>
          <tr>
            <td width="38%" align="right">密码:</td>
            <td width="62%" align="left">
              <input type="password" name="password" size="17" maxlength="16">
            </td>
          </tr>
        </table>
        <input type="submit" name="b1" value="进入">
      </form>
    </td>
  </tr>
  <tr bgcolor="#CCFF99">  
    <td>
      <div align="center"><b>论坛信息</b></div>
    </td>
  </tr>
  <tr valign="top">  
    <td>  
<?php include "info.php";?>
    </td>
  </tr>
</table>
</body>
</html>
<?php
}
?>
## oper.php
<?php
require "func.php";
if (adminok()) {
    if (isset($add_board)) {
        if (isset($name) and isset($chinesename) and !is_board_exits($name)) {
            create_board_table($name,$chinesename);
        }
        else {
            echo "出现错误!(可能版面已经存在)";
            $founderr=1;
        }
    }
    elseif (isset($del_board)) {
        if (isset($board)) {
            drop_board_table($board);
        }
        else {
            echo "出现错误!(请选择要删除的版面)";
            $founderr=1;
        }
    }
    elseif (isset($modify)) {
        if (isset($name) and isset($chinesename)) {
            update_board($name,$chinesename);
        }
        else {
            echo "出现错误!(请填写完整)";
            $founderr=1;
        }
    }
    elseif (isset($add_admin)) {
        if (is_user_exits($name) and isset($board)) {
            add_admin($board,$name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    elseif (isset($delete_admin)) {
        if (is_user_exits($name)) {
            del_admin($name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    else {
        echo "你要干什么?";
        $founderr=1;
    }
    if (!$founderr) {
        redirect2("admin.php");
    }
}
else {
    show_error(1);
}
?>

PHP 相关文章推荐
浅析PKI加密解密 OpenSSL
Jul 01 PHP
8个必备的PHP功能实例代码
Oct 27 PHP
php解压文件代码实现php在线解压
Feb 13 PHP
PHP中怎样防止SQL注入分析
Oct 23 PHP
PHP操作MySQL事务实例
Nov 05 PHP
php进行支付宝开发中return_url和notify_url的区别分析
Dec 22 PHP
PHP利用hash冲突漏洞进行DDoS攻击的方法分析
Mar 26 PHP
php动态函数调用方法
May 21 PHP
PHP-FPM实现性能优化
Mar 31 PHP
thinkphp3.x连接mysql数据库的方法(具体操作步骤)
May 19 PHP
PHP的简单跳转提示的实现详解
Mar 14 PHP
PHP session垃圾回收机制实例分析
Jun 28 PHP
基于mysql的论坛(6)
Oct 09 #PHP
生成sessionid和随机密码的例子
Oct 09 #PHP
基于mysql的论坛(7)
Oct 09 #PHP
基于mysql的论坛(3)
Oct 09 #PHP
一个简单的域名注册情况查询程序
Oct 09 #PHP
不用数据库的多用户文件自由上传投票系统(2)
Oct 09 #PHP
PHP4实际应用经验篇(4)
Oct 09 #PHP
You might like
星际争霸兵种名称对照表
2020/03/04 星际争霸
PHP实现的简单缓存类
2015/07/29 PHP
优化WordPress中文章与评论的时间显示
2016/01/12 PHP
JavaScript让网页出现渐隐渐显背景颜色的方法
2015/04/21 Javascript
逐一介绍Jquery data()、Jquery stop()、jquery delay()函数(详)
2015/11/04 Javascript
实例讲解js验证表单项是否为空的方法
2016/01/09 Javascript
AngularJS延迟加载html template
2016/07/27 Javascript
jQuery EasyUI常用数据验证汇总
2016/09/18 Javascript
浅谈javascript中的事件冒泡和事件捕获
2016/12/28 Javascript
JS正则表达式验证密码格式的集中情况总结
2017/02/23 Javascript
JavaScript操作文件_动力节点Java学院整理
2017/06/30 Javascript
React-router v4 路由配置方法小结
2017/08/08 Javascript
Vue 多层组件嵌套二种实现方式(测试实例)
2017/09/08 Javascript
在Vue项目中使用d3.js的实例代码
2018/05/01 Javascript
vue里如何主动销毁keep-alive缓存的组件
2019/03/21 Javascript
Node.js+Express+Mysql 实现增删改查
2019/04/03 Javascript
JavaScript JSON使用原理及注意事项
2020/07/30 Javascript
微信小程序实现简单购物车功能
2020/12/30 Javascript
使用Python爬了4400条淘宝商品数据,竟发现了这些“潜规则”
2018/03/23 Python
对pandas中时间窗函数rolling的使用详解
2018/11/28 Python
浅谈pyqt5在QMainWindow中布局的问题
2019/06/21 Python
python视频按帧截取图片工具
2019/07/23 Python
python字典的setdefault的巧妙用法
2019/08/07 Python
Python matplotlib绘制图形实例(包括点,曲线,注释和箭头)
2020/04/17 Python
python rsa-oaep加密的示例代码
2020/09/23 Python
浅谈anaconda python 版本对应关系
2020/10/07 Python
CSS实现雨滴动画效果的实例代码
2019/10/08 HTML / CSS
化验室技术员岗位职责
2013/12/24 职场文书
志愿者活动总结范文
2014/04/26 职场文书
服务行业口号
2014/06/11 职场文书
2015年学校关工委工作总结
2015/04/03 职场文书
监守自盗观后感
2015/06/10 职场文书
文化大革命观后感
2015/06/17 职场文书
2015年除四害工作总结
2015/07/23 职场文书
详解nginx location指令
2022/01/18 Servers
Python学习之包与模块详解
2022/03/19 Python