基于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 相关文章推荐
php巧获服务器端信息
Dec 06 PHP
php中时间轴开发(刚刚、5分钟前、昨天10:23等)
Oct 03 PHP
php截取中文字符串不乱码的方法
Dec 25 PHP
php获取发送给用户的header信息的方法
Mar 16 PHP
Laravel 5框架学习之表单
Apr 08 PHP
PHP+MySQL实现无极限分类栏目的方法
Dec 23 PHP
Yii 2.0在Grid中格式化时间方法示例
Jun 06 PHP
php静态成员方法和静态的成员属性的使用方法
Oct 26 PHP
PHP后期静态绑定实例浅析
Dec 21 PHP
实例讲解PHP验证邮箱是否合格
Jan 28 PHP
关于laravel 日志写入失败问题汇总
Oct 17 PHP
PHP Ajax跨域问题解决方案代码实例
Aug 01 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
压力如何影响浓缩咖啡品质
2021/03/03 咖啡文化
PHP安装攻略:常见问题解答(二)
2006/10/09 PHP
PHP foreach循环使用详解与实例代码
2010/05/08 PHP
joomla内置的表单验证功能使用方法
2010/06/11 PHP
PHP 使用header函数设置HTTP头的示例解析 表头
2013/06/17 PHP
Laravel如何实现适合Api的异常处理响应格式
2020/06/14 PHP
node.js中的path.sep方法使用说明
2014/12/08 Javascript
javascript实现瀑布流自适应遇到的问题及解决方案
2015/01/28 Javascript
js基于面向对象实现网页TAB选项卡菜单效果代码
2015/09/09 Javascript
JS实现的自定义水平滚动字体插件完整实例
2016/06/17 Javascript
js实现右键自定义菜单
2016/12/03 Javascript
jquery滚动条插件slimScroll使用方法
2017/02/09 Javascript
jquery 实现拖动文件上传加载进度条功能
2018/03/18 jQuery
JavaScript学习笔记之DOM操作实例分析
2019/01/08 Javascript
JS计算两个数组的交集、差集、并集、补集(多种实现方式)
2019/05/21 Javascript
vue-week-picker实现支持按周切换的日历
2019/06/26 Javascript
vue 调用 RESTful风格接口操作
2020/08/11 Javascript
[01:03:50]DOTA2-DPC中国联赛 正赛 CDEC vs DLG BO3 第二场 2月7日
2021/03/11 DOTA
python访问系统环境变量的方法
2015/04/29 Python
python实现获取Ip归属地等信息
2016/08/27 Python
利用numpy和pandas处理csv文件中的时间方法
2018/04/19 Python
python生成requirements.txt的两种方法
2019/09/18 Python
将python安装信息加入注册表的示例
2019/11/20 Python
py-charm延长试用期限实例
2019/12/22 Python
python操作yaml说明
2020/04/08 Python
庆元旦广播稿
2014/02/10 职场文书
生日礼品店创业计划书范文
2014/03/21 职场文书
《诚实与信任》教学反思
2014/04/10 职场文书
房屋维修协议书范本
2014/09/25 职场文书
教师工作决心书
2015/02/04 职场文书
大学生村官个人总结
2015/02/15 职场文书
化妆品促销活动总结
2015/05/07 职场文书
事业单位工作人员岗前培训心得体会
2016/01/08 职场文书
详细分析PHP7与PHP5区别
2021/06/26 PHP
spring boot项目application.properties文件存放及使用介绍
2021/06/30 Java/Android
MySQL的全局锁和表级锁的具体使用
2021/08/23 MySQL