1.index.php

<html>
 <!--功能:php论坛标题部分--> 
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>论坛首页</title>
<style type="text/css" media="all">
body { margin:0px; padding:0px; font:12px verdana, arial, helvetica, sans-serif;}
td, legend{ font-size:14px; line-height:16px;}
p { font-size:12px;}
<!-- HTML头样式 -->
#Header { margin:10px 0px 10px 0px; padding:10px 8px 8px 20px; border-style:solid;
 border-color:green; background-color:#eee; font-size:14px; height:14px;
}
<!--HTML正文内容样式 -->
#Content { margin:5px; width:100%; padding:10px;}
</style>
</head>
<body>
<center>
<h1>论坛首页</h1>
</center>
<!-- 头开始 -->
<div id="Header">
<?php
 include "config.inc.php";

  //判断用户是否登录,从而显示不同的导航界面
  if($_SESSION['username'])
  {
?>
 <!-- 用户登录后的导航条 -->
 <strong><?php echo $_SESSION['username']; ?>,欢迎登录</strong> | &nbsp;
 <a href="main_forum.php">主页</a> | &nbsp;
 <a href="edit_profile.php">个人资料</a> | &nbsp;
 <a href="logoff_user.php">退出论坛</a>
<?php } else { ?>
 <!-- 用户未登录的导航条 -->
 <a href="main_forum.php">主页</a> | &nbsp;
 <a href="create_user.php">注册</a> | &nbsp;
 <a href="logon_forum.php">登录</a>
<?php
  }//判断结束
?>
 <br>
</div>
<!-- 头结束 -->
<!-- 正文内容开始 -->
<div id="Content">

 

2.main_forum.php

<?php
  //**************************************
  //*  功能:论坛主页面   
  //**************************************

  require('config.inc.php');
  //取得当前页数
  $page=$_GET['page'];
  //每页最多显示的记录数
  $each_page = EACH_PAGE;
  //计算页面开始位置
  if(!$page || $page == 1)
  {
 $start = 0;
  }else{
 $offset = $page - 1;
 $start = ($offset * $each_page);
  }
?>

<h2>
论坛主页
&nbsp;&nbsp;&nbsp;<a href="edit_profile.php">个人资料</a>
&nbsp;&nbsp;&nbsp;<a href="logoff_user.php">注销用户</a>
<form action="main_search.php" method="post">
<input type="text" name="keys">
<input type="submit" name="subs" value="Search Topic">
</form>
</h2>

<?php
  //检索记录,按照置顶标记和时间排序
  $sql = "SELECT * FROM forum_topic
     ORDER BY sticky DESC, datetime DESC LIMIT $start, $each_page";
  $result = mysql_query($sql);
?>
<table width="100%" border="0" align="center"
 cellpadding="3" cellspacing="1" bgcolor="#111">
<tr bgcolor="#E6E6E6">
<td width="60%" align="center"><strong>帖子</strong></td>
<td width="8%" align="center"><strong>访问量</strong></td>
<td width="8%" align="center"><strong>回复数</strong></td>
<td width="24%" align="center"><strong>日期</strong></td>
</tr>
<?php
  //循环输出输出记录列表
  while($rows=mysql_fetch_array($result))
  {
?>
<tr bgcolor="#FFFFFF">
  <td>
<?php
 //如果是“置顶”的记录
 if ($rows['sticky'] == "1")
 {
   ?><img src="sticky.jpg" alt="置顶" border="0"><?php
 }
   //如果是“锁定”的记录
 if ($rows['locked'] == "1")
 {
   ?><img src="lock.jpg" alt="锁定" border="0"><?php
 }
?>
 <a href="view_topic.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['topic']; ?></a>
  </td>
  <td align="center">
   <?php
  echo $rows['view'];  //浏览量
   ?>
  </td>
  <td align="center">
   <?php
  echo $rows['reply'];  //回复量
   ?>
  </td>
  <td align="center">
   <?php
  echo $rows['datetime'];  //日期
   ?>
  </td>
</tr>
<?php
  } //退出while循环
?>
<tr>
  <td colspan="5" align="right" bgcolor="#E6E6E6">
 <input type="button" onClick="location.href='create_topic.php'" value="创建新帖子">
  </td>
</tr>
</table>

<?php
  //计算前一页
  if($page > 1)
  {
 $prevpage = $page - 1;
  }
  //当前记录
  $currentend = $start + EACH_PAGE;
  //取得所有的记录数
  $sql = "SELECT COUNT(*) FROM forum_topic";
  $result = mysql_query($sql);
  $row = mysql_fetch_row($result);
  $total = $row[0];
  //计算后一页
  if($total>$currentend)
  {
 if(!$page){
  $nextpage = 2;
 }else{
  $nextpage = $page + 1;
 }
  }
?>
</p>
<p style="text-align: right;">
<?php
  //判断分页并输出
  if ($prevpage || $nextpage)
  {
 //前一页
 if($prevpage)
 {
  echo "<a href=\"?page={$prevpage}\"><< 前一页</a> ";
 }else{
  echo "&nbsp";
 }
 //后一页
 if($nextpage)
 {
  echo "<a href=\"?page={$nextpage}\">后一页 >></a> ";
 }else{
  echo "&nbsp";
 }
  }
?>
</p>
<h3 align="right">标志</h3>
<p align="right">
<img src="sticky.jpg" alt="Sticky" border="0" align="absmiddle"> 置顶的帖子<br/><br/>
<img src="lock.jpg" alt="Locked" border="0" align="absmiddle"> 锁定的帖子<br/><br/>
<?php
 //检索在线用户
 $sql = "SELECT COUNT(*) FROM forum_user";
 $result = mysql_query($sql);
 $row = mysql_fetch_row($result);
 $total_user = $row[0];
?>
共有<b><?php echo $total_user ?></b>位注册的用户。</p>
<?php
  //公用尾部页面
  include('footer.inc.php')
?>

 

3.main_search.php

<?php
session_cache_limiter('private, must-revalidate');
require "config.inc.php";

if(!empty($_POST['keys'])){
 $w="`topic` like '%".$_POST['keys']."%'";
}else{
 $w=1;
}
$sear="select * from `forum_topic` where $w order by id desc limit 10";
$query=mysql_query($sear);
if($w!=1){
while($rs=mysql_fetch_array($query)){
 echo "Post Man:&nbsp;".$rs['name']."<br/>";
 echo "Topic:&nbsp;";
?>
 <a href="view_topic.php?id=<?php echo $rs['id']; ?>"><?php echo $rs['topic']; ?></a>
 <?php
 echo "<br/>"."<br/>";
}
}else{
 echo "<a href='main_forum.php'>go back</a>";
}
?>

 

4.view_profile.php

<?php
include "config.inc.php";
include "header.inc.php";
$id=$_GET['id'];

$sql="select username,email,realname,regdate from forum_user where username='$id'";
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs);
if(isset($row)){
 echo "username:&nbsp;&nbsp;&nbsp;".$row['username']."<br/>";
 echo "email:&nbsp;&nbsp;&nbsp;".$row['email']."<br/>";
 echo "realname:&nbsp;&nbsp;&nbsp;".$row['realname']."<br/>";
 echo "register date:&nbsp;&nbsp;&nbsp;".$row['regdate']."<br/>";
 echo "<a href='main_forum.php'><font size='5'>go back</font></a>";
}else{
 echo "查询数据库出错!";
}
?>

 

5.logoff_user.php

<?php
session_start();
//从session中获取登录用户名
$username=$_SESSION["username"];
//删除所有Session的变量
$_SESSION=array();
//判断是否是使用基于Cookie的Session,删除包含Session ID的Cookie
if(isset($_COOKIE[session_name()])){
 setcookie(session_name(),'',time()-42000,'/');
}

//彻底销毁Session
session_destroy();
?>

<html>
<head>
<title>退出论坛</title>
</head>

<body>
<p><?php echo $username?>&nbsp;Bye!</p>
<p>请点击<a href="index.php">这里</a>注销并退出。</p>
</body>
</html>

 

6.view_topic.php

<?php
  //**************************************
  //*  功能:文章详细页面   
  //**************************************

  require('config.inc.php');
  //根据ID取得贴子记录
  $id=$_GET['id'];
  $sql="SELECT * FROM forum_topic WHERE id='$id'";
  $result=mysql_query($sql);
  $rows=mysql_fetch_array($result);
  //记录不存在
  if (!$rows)
  {
 ExitMessage("该贴记录不存在!", "main_forum.php");
  }
  //置顶标记
  $sticky=$rows['sticky'];
?>
<?php include('header.inc.php'); ?>
<h2><? echo $rows['topic']; ?></h2>
<em class="info">
 <a href="view_profile.php?id=<?php echo $rows['name']; ?>">
 <? echo $rows['name']; ?></a> 于 <? echo $rows['datetime']; ?>
 创建
</em>
<p>
<?php
 //输出整理好的内容
 echo nl2br(htmlspecialchars($rows['detail']));
?>
</p>
<?php if ($rows['locked']) { $locked = 1; } ?>
<hr size=1 />
<dl>
<?php
  //获取回复内容
  $sql ="SELECT * FROM forum_reply WHERE topic_id='$id'";
  $result = mysql_query($sql);
  $num_rows = mysql_num_rows($result);
  if ($num_rows)
  {
 //循环取出记录内容
 while($rows=mysql_fetch_array($result))
 {
?>
 <dt>
    <a href="view_profile.php?id=<?php echo $rows['reply_name']; ?>">
     <? echo $rows['reply_name']; ?>
    </a>
     - <em><?php echo $rows['reply_datetime']; ?></em>
 </dt>
 <dd>
  <p><?php
     //输出整理好的内容
     echo nl2br(htmlspecialchars($rows['reply_detail']));
     ?></p>
 </dd>
 <?
 }//结束循环
  }else{
 echo "<p><strong>没有跟贴记录。</strong></p>";
  }
  //浏览量加1
  $sql = "UPDATE forum_topic set view=view+1 WHERE id='$id'";
  $result = mysql_query($sql);
?>
</dl>
<!--内容回复表单,开始-->
<fieldset>
<legend>贴子回复</legend>
<?php
//判断用户是否已经注册
if (!$_SESSION['username'])
{
 echo '<p>请先<a href="create_user.php">注册</a>,
    或者<a href="logon_forum.php">登录</a>或后进行操作。<br>&nbsp;</p>';
} else {
 //帖子已经被锁定
 if ($locked == 1)
 {
  echo '<p><strong>该贴是被锁定的,无法回帖</strong><br>&nbsp;</p>';
 }else{
?>
<form name="form1" method="post" action="add_reply.php" id="reply">
 <input name="id" type="hidden" value="<? echo $id; ?>">
 <table>
  <tr>
  <td>&nbsp;</td>
   <td>
    <textarea name="reply_detail" cols="45" rows="10"></textarea>
   </td>
  </tr>
 </table>
 <br />
 &nbsp;&nbsp;
 <input type="submit" name="Submit" value="回复该帖" class="button" />
 <input type="reset" name="Reset" class="button" />
</form>
<?php } ?>
</fieldset><br>
<!--内容回复表单,结束-->
<?php
  //如果是管理员用户,则输出“置顶”、“锁定”和“删除”按钮
  if ($_SESSION['username'] == ADMIN_USER)
  {
?>
<!--管理员操作表单,开始-->
<fieldset>
<legend>管理员操作</legend>
   <!--显示锁定操作按钮-->
   <?php if ($locked == 0) { ?>
 <form name="lock" method="post" action="lock_topic.php">
  <input type="hidden" name="id" value="<?php echo $id; ?>">
  <input type="submit" name="Submit" value="锁定该贴" class="button">
  将该贴锁定,其他用户无法回复
 </form>
  <?php }else{ ?>
 <form name="unlock" method="post" action="unlock_topic.php">
  <input type="hidden" name="id" value="<?php echo $id; ?>">
  <input type="submit" name="Submit" value="解除锁定" class="button">
  解除锁定,其他人可以回复
 </form>
  <?php } ?>
  <!--显示置顶操作按钮-->
  <?php if ($sticky == 0) { ?>
 <form name="stick" method="post" action="stick_topic.php">
  <input type="hidden" name="id" value="<?php echo $id; ?>">
  <input type="submit" name="Submit" value="置顶该贴" class="button">
  将该贴置于顶端
 </form>
  <?php } else { ?>
 <form name="unstick" method="post" action="unstick_topic.php">
  <input type="hidden" name="id" value="<?php echo $id; ?>">
  <input type="submit" name="Submit" value="取消置顶" class="button">
  取消该贴置顶
 </form>
  <?php } ?>
  <!--显示删除操作按钮-->
  <form name="delete" method="get" action="del_topic.php">
  <input type="hidden" name="id" value="<?php echo $id; ?>">
  <input type="submit" name="Submit" value="删除帖子" class="button">
  删除该帖与回复内容
  </form>
</fieldset>
<!--管理员操作表单,结束-->
<?php
 }
}
?>
<?php
include('footer.inc.php');
 ?>

 

7.update_profile.php

<?php
  //**************************************
  //*  功能:用户资料修改页面  
  //**************************************

  require('config.inc.php');
  if (!$_SESSION['username']) {
 ExitMessage("请<b>登录</b>后执行该请求 ", "logon_form.php");
  }
  //用户名
  $username=$_SESSION['username'];
  //电子邮件
  $email=ClearSpecialChars($_POST['email']);
  //真实姓名
  $realname=ClearSpecialChars($_POST['realname']);
  //用户密码
  $password=$_POST['password'];
  if (!$password)
  {
 //如果密码为空,则密码项不予更新
 $sql="UPDATE forum_user
   SET email = '$email',
   realname = '$realname'
    WHERE username = '$username'";
  } else {
 //如果输入了新的密码,则密码项也予以更新
 //$password = md5($password);
 $sql="UPDATE forum_user
   SET password = '$password',
   email = '$email',
   realname = '$realname'
    WHERE username = '$username'";
  }
  $result=mysql_query($sql);
  if($result){
?>
<h2>个人资料更新成功</h2>
<p>
 您的个人资料已经被成功更新
 请<a href="main_forum.php">返回</a>论坛主页
</p>
<?php
  }
  else {
 ExitMessage("记录不存在!");
  }
?>

 

8.unstick_topic.php

<?php
  //**************************************
  //*  功能:取消“置顶”操作  
  //**************************************

  require('config.inc.php');
  //判断是否为管理员
  if ($_SESSION['username'] == ADMIN_USER)
  {
 //取得文章ID
 $id=$_POST['id'];
 //取消“置顶”的SQL语句
 $sql = "UPDATE forum_topic SET sticky='0' WHERE id='$id'";
 $result=mysql_query($sql);
 if($result)
 {
  //跳转页面
  header("Location: view_topic.php?id=$id");
 }
 else {
  ExitMessage("数据库操作错误!");
 }
  } else {
 ExitMessage("你没有管理权限!");
  }
?>

 

9.unlock_topic.php

<?php
  //**************************************
  //*  功能:取消“锁定”操作  
  //**************************************

  require('config.inc.php');
  //判断是否为管理员
  if ($_SESSION['username'] == ADMIN_USER)
  {
 //取得文章ID
 $id=$_POST['id'];
 //取消“锁定”的SQL语句
 $sql = "UPDATE forum_topic SET locked='0' WHERE id='$id'";
 $result=mysql_query($sql);
 if($result)
 {
  //跳转页面
  header("Location: view_topic.php?id=$id");
 }
 else {
  ExitMessage("数据库操作错误!");
 }
  } else {
 ExitMessage("你没有管理权限!");
  }
?>

 

10.stick_topic.php

<?php
  //**************************************
  //*  功能:设置“置顶”操作  
  //**************************************

  require('config.inc.php');
  //判断是否为管理员
  if ($_SESSION['username'] == ADMIN_USER)
  {
 //取得文章ID
 $id=$_POST['id'];
 //设置“置顶”的SQL语句
 $sql = "UPDATE forum_topic SET sticky='1' WHERE id='$id'";
 $result=mysql_query($sql);
 if($result)
 {
  //跳转页面
  header("Location: view_topic.php?id=$id");
 }
 else {
  ExitMessage("数据库操作错误!");
 }
  } else {
 ExitMessage("你没有管理权限!");
  }
?>

 

11.logon_forum.php

<?php
  //**************************************
  //*  功能:用户登录程序   
  //**************************************

  require('config.inc.php');
  if($_POST['submit'])
  {
 //用户名
 $username=ClearSpecialChars($_POST['username']);
 $password=$_POST['password'];
 //密码,需要进行MD5加密
 //$password=md5($_POST['password']);
 //从数据库中检索用户名,密码是否匹配
 $sql = "SELECT * FROM forum_user
    WHERE username='$username' AND password='$password'";
 $result = mysql_query($sql);
 $num_rows = mysql_num_rows($result);
 if($num_rows == 1)
 {
  //获得用户名
  $row = mysql_fetch_assoc($result);
  //将用户名存入SESSION中
  $_SESSION['username'] = $row['username'];
  //跳转到论坛主页面
  header("Location: main_forum.php");
 }
 else {
  ExitMessage("用户名或者密码错误!", "logon_forum.php");
 }
  }
  else{
 //公用头部页面
 //include('header.inc.php');
?>
<h2>用户登录</h2>
<fieldset>
<form method="post" action="logon_forum.php">
<table>
  <tr>
 <td>用户名:</td>
    <td><input name="username" type="text"></td>
  </tr>
  <tr>
    <td>密 码:</td>
 <td><input name="password" type="password"></td>
  </tr>
</table>
<input type="submit" name="submit" value="登录" class="button">
</form>
</fieldset>
<?php
  }
  //公用尾部页面
  include('footer.inc.php');
?>

 

12.lock_topic.php

<?php
  //************************************** 
  //*  功能:设置“锁定”操作  
  //**************************************

  require('config.inc.php');
  //判断是否为管理员
  if ($_SESSION['username'] == ADMIN_USER)
  {
 //取得文章ID
 $id=$_POST['id'];
 //锁定的SQL语句
 $sql = "UPDATE forum_topic SET locked='1' WHERE id='$id'";
 $result=mysql_query($sql);
 if($result)
 {
  //跳转页面
  header("Location: view_topic.php?id=$id");
 }
 else {
  ExitMessage("数据库操作错误!");
 }
  } else {
 ExitMessage("你没有管理权限!");
  }
?>

 

13.header.inc.php

<?php
 //*   初始化程序    *
 //*******************
 //开启SESSION
 session_start();
 //打开数据库连接
 $db = mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD);
 if (!$db)
 {
    die('<b>数据库连接失败!</b>');
    exit;
 }
 //选择数据库
 mysql_select_db (DB_NAME);
?>

 

14.footer.inc.php

<!---功能:共用尾部页面-!>

<!-- 正文内容结束 -->
<!-- 版权信息 -->
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<center>
<table border=0>
  <tr>
 <td><span class="STYLE1">版权所有</span>:KARMA</td>
  </tr>
  </center>
</table>
</body>
</html>

 

15.edit_profile.php

<?php
  //******************************************
  //*  功能:用户资料修改页面   
  //******************************************

  require('config.inc.php');
  //用户名
  $id = $_SESSION['username'];
  //如果用户没有登录
  if (!$_SESSION['username']) {
 ExitMessage("请登录后执行该请求。", "logon_forum.php");
  }
?>

<h2>编辑个人资料</h2>
<?php
  //查询用户资料
  $sql="SELECT * FROM forum_user WHERE username = '$id'";
  $result=mysql_query($sql);
  $rows=mysql_fetch_array($result);
?>
<fieldset>
 <legend>个人资料</legend>
<form method="post" action="update_profile.php">
<table>
  <tr>
    <td>登录用户:</td>
    <td><b><? echo $rows['username']; ?></b></td>
  </tr>
  <tr>
 <td>
 更新密码:</td><td><input name="password" type="password">
 </td>
  </tr>
  <tr>
 <td>电子邮件:</td>
 <td><input name="email" type="text"
   value="<?php echo $rows['email']; ?>"></td>
  </tr>
  <tr>
 <td>真实姓名:</td>
 <td><input name="realname" type="text"
    value="<?php echo $rows['realname']; ?>"></td>
  </tr>
</table>
<br><br>
<input type="submit" name="submit" value="更新个人资料" class="button">
</form>
</fieldset>
<?php include('footer.inc.php');?>
 

 

16.del_topic.php

<?php
  //**************************************
  //*  功能:删除文章内容操作  
  //**************************************

  require('config.inc.php');
  //判断是否为管理员
  if ($_SESSION['username'] == ADMIN_USER)
  {
 // get data that sent from form
 $id=$_GET['id'];
 //删除文章
 $sql = "DELETE FROM forum_topic WHERE id=$id";
 $result=mysql_query($sql);
 //删除回复内容
 $sql2 = "DELETE FROM forum_reply WHERE topic_id=$id";
 $result2=mysql_query($sql2);
 if($result AND $result2)
 {
  //页面跳转
  header("Location: main_forum.php");
 }
 else {
  ExitMessage("数据库操作错误!");
 }
  } else {
 ExitMessage("你没有管理权限!");
  }
?>

 

17.create_user.php

<?php
  //************************************** 
  // 功能:生成用户注册页面  
  //**************************************

  require('config.inc.php');
  include('header.inc.php');
?>
<h2>注册新用户</h2>
<fieldset>
<form method="post" action="add_user.php">
<table>
  <tr>
 <td>用户名:</td>
 <td><input name="username" type="text"></td>
  </tr>
  <tr>
    <td>密 码:</td>
    <td><input name="password" type="password"></td>
  </tr>
  <tr>
    <td>E-mail:</td>
    <td><input name="email" type="text"></td>
  </tr>
  <tr>
    <td>真实姓名:</td>
    <td><input name="realname" type="text"></td>
  </tr>
</table>
<input type="submit" name="Submit" value="提交注册" class="button"/>
<input type="reset" name="Submit2" value="清空" class="button"/>
</form>
</fieldset>
<?php
 //公用尾部页面
 include('footer.inc.php');
?>

 

18.create_topic.php

<?php
  //***********************************
  //*      功能:发表文章页面  
  //***********************************

  require('config.inc.php');
  include('header.inc.php');
?>
<h2>创建新贴</h2>
<?php
  if (!$_SESSION['username'])
  {
   //如果用户未登录,显示错误信息
?>
<h3>未注册的用户</h3>
<p>对不起,请<a href="create_user.php">注册</a>新用户,
 或者进行<a href="logon_forum.php">登录</a>
</p>
<?php
  }else{
 //如果用户登录,显示输入表单
?>
<h3>发言注意事项</h3>
<ul>
 <li>所有项目必须填写。</li>
 <li>在标题和正文中不能使用HTML代码。</li>
</ul>
<form method="post" action="add_topic.php" id="postComment">
<table>
  <tr>
 <td>话题</td>
 <td><input name="topic" type="text" id="topic" size="50"><td>
  </tr>
  <tr>
    <td>正文</td>
    <td><textarea name="detail" cols="50" rows="10" id="detail"></textarea></td>
  </tr>
</table>
<?php
  //如果是管理员,将显示“置顶”和“锁定”功能
  if ($_SESSION['username'] == ADMIN_USER)
  {
?>
 <br>将帖子置顶 <input type="checkbox" name="sticky" value="on">
 <br>锁定该帖子 <input type="checkbox" name="locked" value="on">
<?php
  }
?>
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="立即发布" class="button">
<input type="reset" name="Submit2" class="button">
</form>
<?php } ?>
<?php
 //公用尾部页面
 include('footer.inc.php');
?>

 

19.add_reply.php

<?php
  //************************************** 
  //*  功能:回复文章保存页面  
  //***************************************

  require('config.inc.php');
  //判断用户是否登录
  if (!$_SESSION['username'])
  {
 ExitMessage("请<b>登录</b>后执行该请求。", "logon_form.php");
  }
  //回帖的ID
  $id=$_POST['id'];
  //验证帖子已经存在,未被锁定
  $sql = "SELECT * from forum_topic WHERE id='$id'";
  $result = mysql_query($sql);
  $topic_info = mysql_fetch_array($result);
  if (!$topic_info)
  {
 ExitMessage("帖子记录不存在!", "main_forum.php");
  }
  if ($topic_info['locked'] == 1)
  {
 ExitMessage("该贴已经被锁定,无法进行回复。");
  }
  //取得用户信息
  $username = $_SESSION['username'];
  $sql = "SELECT * from forum_user WHERE username='$username'";
  $result = mysql_query($sql);
  $user_info = mysql_fetch_array($result);
  //取得提交过来的数据
  $reply_name=$_SESSION['username'];
  $reply_email=$user_info['email'];
  $reply_detail=filterBadWords($_POST['reply_detail']);
  if (!$reply_detail)
  {
 ExitMessage("没有回贴记录!", "main_forum.php");
  }
  //取得reply_id的最大值
  $sql = "SELECT Count(reply_id) AS MaxReplyId
  FROM forum_reply WHERE topic_id='$id'";
  $result=mysql_query($sql);
  $rows=mysql_fetch_row($result);
  //将reply_id最大值+1,如果没有该值,则设置为1。
  if ($rows)
  {
 $Max_id = $rows[0]+1;
  }
  else {
 $Max_id = 1;
  }
  //插入回复数据
  $sql="INSERT INTO forum_reply (topic_id, reply_id, reply_name,
  reply_email, reply_detail, reply_datetime)
  VALUES('$id', '$Max_id', '$reply_name',
  '$reply_email', '$reply_detail', NOW())";
  $result=mysql_query($sql);
  if($result)
  {
 //更新reply字段
 $sql="UPDATE forum_topic SET reply='$Max_id' WHERE id='$id'";
 $result=mysql_query($sql);
 //页面跳转
 header("Location: view_topic.php?id=$id");
  }
  else {
 ExitMessage("记录不存在");
  }
?>

 

20.add_topic.php

<?php
  //**************************************  
  //*  功能:发表文章程序   
  //**************************************

  require('config.inc.php');
  if (!$_SESSION['username'])
  {
 //如果用户未登录,显示错误信息
 include('header.inc.php'); //头文件
?>
<h2>创建新贴</h2>
<h3>未注册的用户</h3>
<p>对不起,请<a href="create_user.php">注册</a>新用户
 或者进行<a href="logon_forum.php">登录</a>。
</p>
<?php
 include('footer.inc.php');  //尾文件
  } else {
 //获得用户信息
 $username = $_SESSION['username'];
 $sql = "SELECT * from forum_user WHERE username='$username'";
 $result = mysql_query($sql);
 $info = mysql_fetch_array($result);
 //取得传递来的值
 //标题
 $topic = filterBadWords($_POST['topic']);  //标题的脏字过滤
 //正文
 $detail = filterBadWords($_POST['detail']);  //正文的脏字过滤
 //发帖人
 $name = $_SESSION['username'];
 //电子邮件地址
 $email = $info['email'];
 //是否置顶
 $sticky = $_POST['sticky'];
 //是否锁定
 $locked = $_POST['locked'];
 //数据合法性检查
 if (!$topic)
 {
  ExitMessage("请输入标题!");
 }
 if (!$detail)
 {
  ExitMessage("请输入正文!");
 }
 //判断是否为锁定状态
 if ($locked == "on" && $name == ADMIN_USER) {
  $locked = 1;
 }
 else {
  $locked = 0;
 }
 //判断是否置顶状态
 if ($sticky == "on" && $name == ADMIN_USER) {
  $sticky = 1;
 }
 else {
  $sticky = 0;
 }
 //将数据插入数据库
 $sql="INSERT INTO forum_topic(topic, detail, name, email, datetime, locked, sticky)
   VALUES('$topic', '$detail', '$name', '$email',NOW(), '$locked', '$sticky')";
 $result=mysql_query($sql);
 if($result)
 {
  //成功后,跳转页面到论坛主页面
  header("Location: main_forum.php");
 }
 else
 {
  ExitMessage("数据库错误!");
 }
}
?>

 

21.add_user.php

<?php
  //**********************************
  //*    功能:添加注册用户记录 
  //**********************************

  require('config.inc.php');
  //取得提交的数据,并做清理
  //用户名
  $username = ClearSpecialChars($_POST['username']);
  //密码
  $password = $_POST['password'];
  //电子邮件地址
  $email  = ClearSpecialChars($_POST['email']);
  //真实姓名
  $realname = ClearSpecialChars($_POST['realname']);
  //检验数据的合法性
  if (!$username) {
 ExitMessage('请输入用户名!');
  }
  if (!$password) {
  ExitMessage('请输入密码!');
  }
  if (!$email) {
 ExitMessage('请输入电子邮件地址!');
  }
  else if(!checkEmail($email)){
 ExitMessage('电子邮件地址格式错误!');
  }
  //对密码进行MD5加密
  //$password=md5($_POST['password']);
  //判断用户是否已经存在
  $sql = "SELECT * FROM forum_user WHERE username='$username'";
  $result = mysql_query($sql);
  $num_rows = mysql_num_rows($result);
  if ($num_rows > 0) {
 ExitMessage('该用户已经存在!');
  }
  //创建用户
  $sql = "INSERT INTO forum_user (username, password, email, realname, regdate)
  VALUES('$username', '$password', '$email', '$realname', NOW())";
  $result = mysql_query($sql);
  if($result)
  {
 ?>
 <h2>创建用户</h2>
 <p>您的用户账号已经建立,请点击<a href="logon_forum.php">这里</a>登录。</p>
 <?php
  }
  else {
 ExitMessage("数据库错误!");
  }
?>

 

22.config.inc.php

<?php
 //*******************
 //  功能:数据库操作程序
 //*******************

 //连接数据库的定义
      //用户名
 define('DB_USER',   "root"); 
  //密码
 define('DB_PASSWORD',  "root"); 
  //数据库主机地址
 define('DB_HOST',   "localhost");
  //数据库
 define('DB_NAME',   "phpforum"); 
 //管理员用户
 define('ADMIN_USER', "admin");
 //分页设置,每页最多显示的记录数
 define('EACH_PAGE',  15);
 //无效的字符,用于ClearSpecialChars()函数
 $invalidchars = array(
  "'",    //单引号
  ";",    //分号
  "=",    //等号
  "\\",    //反斜线
  "/"     //斜线
 );
 //“脏字”数组,用于FilterBadWords()
 $badwords=array
 (
  "fuck", "shit", "wanker", "cunt", "gay",
  "nigger", "bastard", "tosser", "dipshit",
  "homosexual", "nigga", "gaylord", "retard",
  "asshole", "slut", "prick", "cock", "pussy",
  "bitch", "wanking", "bollocks"
 );
 //*******************
 //*  公共函数设置   *
 //*******************
 //功能:检查电子邮件地址格式是否正确
 //输入:电子邮件地址
 //输出:true或false
 function CheckEmail($email)
 {
  $check = "/^[0-9a-zA-Z_-]+@[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+){0,3}$/";
  
  if(preg_match ($check, $email)){
   return true;
  }
  else{
   return false;
  }
 }
 //功能:显示错误信息和返回的链接地址,并终止程序执行
 //输入:错误信息, 链接地址
 //输出:字符串
 function ExitMessage($message, $url='')
 {
  echo '<p class="message">';
  echo $message;
  echo '<br>';
  if($url){
      echo '<a href="'.$url.'">返回</a>';
     }else{
      echo '<a href="#" onClick="window.history.go(-1);">返回</a>';
     }
  echo '</p>';
  exit;
 }
 //功能:清除字符串中的特殊字符
 //输入:字符串
 //输出:字符串
 function ClearSpecialChars($str)
 {
  global $invalidchars;
  $str = trim($str);
  $str = str_replace($invalidchars,"",$str);
  return $str;
 }
 //功能:“脏字”处理程序
 //输入:字符串
 //输出:字符串
 function FilterBadWords($str)
 {
  global $badwords;
  //替代字数组
  $replacements=array("[ensored]", "***");
  for($i=0;$i < sizeof($badwords);$i++)
  {
   //随机函数发生器
   srand((double)microtime()*1000000);
   
   //生成随机代码
   $rand_key = (rand()%sizeof($replacements));
   $str=eregi_replace($badwords[$i], $replacements[$rand_key], $str);
  }
  return $str;
 }
 /*******************/
 /*   初始化程序    */
 /*******************/
 //开启SESSION
 session_start();
 //打开数据库连接
 $db = mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD);
 if (!$db)
 {
    die('<b>数据库连接失败!</b>');
    exit;
 }
 //选择数据库
 mysql_select_db (DB_NAME);
?>

 

SQL语句:

-- MySQL dump 10.11
--
-- Host: localhost    Database: phpforum
-- ------------------------------------------------------
-- Server version    5.0.51a-community-nt

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `forum_reply`
--

DROP TABLE IF EXISTS `forum_reply`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forum_reply` (
  `id` int(20) NOT NULL auto_increment,
  `topic_id` int(20) NOT NULL,
  `reply_id` int(20) NOT NULL,
  `reply_name` varchar(20) NOT NULL,
  `reply_email` text NOT NULL,
  `reply_detail` text NOT NULL,
  `reply_datetime` date NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `forum_reply`
--

LOCK TABLES `forum_reply` WRITE;
/*!40000 ALTER TABLE `forum_reply` DISABLE KEYS */;
INSERT INTO `forum_reply` VALUES (1,3,1,'karma','','huihuihui','2013-12-26'),(9,21,2,'admin','webmaster@gmail.com','admin is mine, i want to go to school!\r\nwhere are you?\r\nif you in the bookstore along the libary now, i could go to bedroom with you at the minutes. ','2013-12-28'),(8,21,1,'xcc','123456@sina.com','i want to go to school, where are you?\r\nif you at the playground now, i could go with you anything time that you want to.','2013-12-28'),(10,21,3,'admin','webmaster@gmail.com','xcc is my school,so you can go to xcc,if you have sometimes.in short,you should go to xcc,i could carry you to qiong lake to in sunshine.\r\n','2013-12-28'),(11,22,1,'struts','35454565@baidu.com','what his cellphone number?\r\nhis cellphone number is:15678909999','2013-12-28'),(12,21,4,'admin','webmaster@gmail.com','你是??','2013-12-28'),(13,21,5,'admin','webmaster@gmail.com','SB??','2013-12-28'),(14,23,1,'karma','123456@qq.com','可以的话call me:\r\n16783456783(cellphone)','2013-12-28'),(15,23,2,'xcc','123456@sina.com','[ensored]!','2013-12-28'),(16,23,3,'xcc','123456@sina.com','[ensored]er!','2013-12-28'),(17,23,4,'xcc','123456@sina.com','fuc!','2013-12-28'),(18,23,5,'xcc','123456@sina.com','f4ck','2013-12-28'),(19,23,6,'xcc','123456@sina.com','好的,就这样!!!','2013-12-28'),(20,24,1,'xcc','123456@sina.com','真是个好东西这论坛!!!','2013-12-28'),(21,21,6,'xcc','123456@sina.com','so F4CK!','2013-12-28'),(22,25,1,'xcc','123456@sina.com','怎么没效果,SB\r\n这个网站太坚固了!!!','2013-12-28'),(23,25,2,'xcc','123456@sina.com','我在政府部门,还没见过这么坚固的网站呢!!!','2013-12-28'),(24,26,1,'xcc','123456@sina.com','楼上SB在干吗??','2013-12-28'),(25,26,2,'xcc','123456@sina.com','good luck!!! just one way, if you want to success.\r\n\r\nMaybe you can go to college to study upstairs.\r\n\r\nso, do you understand my ideas.','2013-12-28'),(26,21,7,'hack','54545454@baidu.com','Hello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!','2013-12-28'),(27,22,2,'xcc','123456@sina.com','good!!!!!','2013-12-29'),(28,28,1,'xcc','123456@sina.com','xxxxxxxxcccccccccccccccccccccccccccc','2013-12-29'),(29,21,8,'xcc','123456@sina.com','Hello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\n','2013-12-29'),(30,21,9,'xcc','123456@sina.com','Hello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\nHello i\'m hack , nice to meet you\r\nToday, i will show my picture to everyone\r\nThe picture told us : everyting is no failed!!!\r\n\r\n','2013-12-29'),(31,27,1,'xcc','123456@sina.com','i\'m chinese , so i\'m love China!!!','2013-12-29'),(32,29,1,'xcc','123456@sina.com','xss\r\n','2013-12-30'),(33,26,3,'xcc','123456@sina.com','xss\r\n!!','2013-12-30'),(34,26,4,'xcc','123456@sina.com','<script>alert(\"xcc\")</script>','2013-12-30'),(35,27,2,'admin','webmaster@gmail.com','xcc\'s students\' idea is so great!!','2013-12-31'),(36,30,1,'xcc','34545454@qq.com','ccccccccccccccccccccccccccccccccc','2014-01-01'),(37,21,10,'xcc','34545454@qq.com','ok,i see,at my school,i will go top of the lu shan mountain,who will go along with me?\r\n','2014-03-02'),(38,21,11,'xcc','34545454@qq.com','everything is ok,so if you want to go here,i will go with you at the monment.','2014-03-02'),(39,25,3,'xcc','34545454@qq.com','是啊,我也是,我觉得我的网站还行吧!!!','2014-03-02');
/*!40000 ALTER TABLE `forum_reply` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `forum_topic`
--

DROP TABLE IF EXISTS `forum_topic`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forum_topic` (
  `id` int(20) NOT NULL auto_increment,
  `topic` text NOT NULL,
  `detail` text NOT NULL,
  `name` text NOT NULL,
  `email` text NOT NULL,
  `datetime` date NOT NULL,
  `locked` varchar(20) NOT NULL,
  `sticky` varchar(20) NOT NULL,
  `reply` int(20) NOT NULL,
  `view` int(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `forum_topic`
--

LOCK TABLES `forum_topic` WRITE;
/*!40000 ALTER TABLE `forum_topic` DISABLE KEYS */;
INSERT INTO `forum_topic` VALUES (27,'xcc student\'s ideas','xcc student\'s ideas is so perfect!','xcc','123456@sina.com','2013-12-29','0','1',2,37),(25,'xcc','<script>alert(\"xss\")</script>','xcc','123456@sina.com','2013-12-28','0','0',3,15),(26,'西昌学院的同学你们好!!!','西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!西昌学院的同学你们好!!!','xcc','123456@sina.com','2013-12-28','0','0',4,17),(21,'i wnt to go to school','i want to go to school,who will go along with me?','xx','123456@qq.com','2013-12-28','0','1',11,72),(22,'struts is a student.','struts is a student,he is study in xcc,so if you have some questions,you can contact him.','struts','35454565@baidu.com','2013-12-28','0','0',2,14),(23,'请问有西院的学生住这里吗??','请问有西院的学生住这里吗??\r\n可以的话,可以聊聊的!\r\n原因是这里有一些学生项目需要你们做,\r\n所以,想找你们帮帮我们,不知道可以不!','karma','123456@qq.com','2013-12-28','1','0',6,56),(24,'zxcv','zxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcvzxcv!!!','xcc','123456@sina.com','2013-12-28','0','0',1,9),(28,'xxxxxxxxxxxxxxxxxxxxx','xxxxxxxxxxxxxx\r\nccccccccccccccc\r\nccccccccccccccc\r\niiiiiiiiiiiiiiii\r\nssssssssssssssss\r\nbbbbbbbbbbbbbbbb\r\naaaaaaaaaaaaaaaa\r\ndddddddddddddddd','xcc','123456@sina.com','2013-12-29','0','0',1,10),(29,'html','html','xcc','123456@sina.com','2013-12-29','0','0',1,5),(30,'xxxxxxxxxxxxxxxx','xxxxxxxxxxxxxxxxxxxx','xcc','34545454@qq.com','2014-01-01','0','0',1,3),(31,'现在的房价太高了~','只能、说买不起啊·','xcc','34545454@qq.com','2014-01-01','0','0',0,1);
/*!40000 ALTER TABLE `forum_topic` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `forum_user`
--

DROP TABLE IF EXISTS `forum_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forum_user` (
  `id` int(20) NOT NULL auto_increment,
  `username` varchar(20) NOT NULL,
  `password` varchar(20) NOT NULL,
  `email` text NOT NULL,
  `realname` text NOT NULL,
  `regdate` date NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `forum_user`
--

LOCK TABLES `forum_user` WRITE;
/*!40000 ALTER TABLE `forum_user` DISABLE KEYS */;
INSERT INTO `forum_user` VALUES (29,'xcc','xcc','34545454@qq.com','xcc','2014-01-01');
/*!40000 ALTER TABLE `forum_user` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2014-04-16 15:35:45

posted on 2014-03-11 15:00  milantgh  阅读(1516)  评论(0编辑  收藏  举报