BBS(php & mysql)完整版(二)


Posted in PHP onOctober 09, 2006

//此页面为look.php
<?
include "signup/mysql.inc";
$sql="select * from ".$table." where id='$id'";
$result=mysql_query($sql)or die(mysql_error());
$row=mysql_fetch_array($result);
$number=++$row["number"];

$sql="update $table set number='$number' where id='$id'";
mysql_query($sql)or die(mysql_error());

?>

<html>
<head>
<title>xiaoyang</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?

include "js/menuhead.php"
?>

<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?

include "js/menu.php";
?>

<div id="Layer6" style="position:absolute; left:409px; top:29px; width:118px; height:17px; z-index:1"></div>
<div id="Layer5" style="position:absolute; left:63px; top:61px; width:464px; height:303px; z-index:2">  

    <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FFCCFF">
      <tr>  

      <td width="22%" height="17">  
        <div align="center"><font color="#FF3399" size="2">题目</font></div>
        </td>

      <td width="78%" height="17">
        <div align="center"><font size="2" color="#9966FF"><?echo $row["title"] ;?></font> </div>
      </td>
      </tr>
      <tr>  
        <td width="22%" height="24">  
          <div align="center"><font color="#FF3399" size="2">作者</font></div>
        </td>

      <td width="78%" height="24">  
        <div align="center"><font size="2" color="#9966FF"><?echo $row["userid"] ;?></font> </div>
      </td>
      </tr>
      <tr>  
        <td width="22%">  
          <div align="center"><font color="#FF3399" size="2">内容</font></div>
        </td>

      <td width="78%">
        <div align="left"><font size="2" color="#9966FF"><? $file=explode("n",$row["content"]); $num=count($file);
        for($i=0 ;$i<$num;$i++) echo "  ".$file[$i]."<BR>";?></font></div>
      </td>
      </tr>
    </table>

   <?

   for($j=1;$j<6;$j++)              //显示回复内容
   {
    $re="r".$j;
    if($row["$re"])
        {
        $id2=$row["$re"];
    $sql="select * from bbs_re where id='$id2'";
    $result=mysql_query($sql)or die(mysql_error());
    $row8=mysql_fetch_array($result);
   echo "<BR>";
   echo " <table width=100% border=1 cellspacing=0 cellpadding=0      bordercolor=#FFCCFF>  <tr>";         
   echo "   <td width=22% height=17>         <div align=center><font color=#FF3399 size=2>题目</font></div>";
   echo "     </td>       <td width=78% height=17>";
   echo " <div align=center><font size=2 color=#9966FF>".$row8["title"]."</font> </div>      </td> </tr>      <tr>";  
   echo "<td width=22% height=24>";  
   echo "<div align=center><font color=#FF3399 size=2>作者</font></div></td>";
   echo " <td width=78% height=24>";  
   echo "<div align=center><font size=2 color=#9966FF>".$row8["userid"]." </font> </div></td> </tr><tr>";  
   echo " <td width=22%><div align=center><font color=#FF3399 size=2>内容</font></div>";
   echo "</td> <td width=78%>";
   echo "<div align=left><font size=2 color=#9966FF>"; $file=explode("n",$row8["content"]);
   $num=count($file);
    for($i=0 ;$i<$num;$i++) echo "  ".$file[$i]."<BR>";
    echo "</font></div>";
   echo "   </td>  </tr>    </table>";
    }
   }

   ?>

<BR><BR>
</div>
<div id="back" style="position:absolute; left:455px; top:30px; width:85px; height:3px; z-index:3">  
  <hr color="#ff9999" noshade>
</div>
<div id="goback" style="position:absolute; left:461px; top:23px; width:120px; height:16px; z-index:2">  
  <div align="center"><a href="php3.php?p=1&&table=<?echo $table ;?>" target="_self" onMouseOver="window.status=''; return true"><font size="2" color="#FF33FF">返回</font></a></div>
</div>
<div id="Lay" style="position:absolute; left:70px; top:30px; width:85px; height:3px; z-index:4">
  <hr noshade color="#ff9999">
</div>
<div id="Laye" style="position:absolute; left:78px; top:23px; width:120px; height:16px; z-index:1">  
  <div align="center"><a href="say.php?id1=<? echo $id."&&table=".$table ;?>" target="_self" onMouseOver="window.status='';return true"><font size="2" color="#FF33FF">回复</font></a></div>
</div>
<p> </p>
<p> </p>
</body>
</html>

PHP 相关文章推荐
玩转图像函数库―常见图形操作
Sep 03 PHP
让你同时上传 1000 个文件 (二)
Oct 09 PHP
Apache中php.ini的设置方法
Feb 28 PHP
处理单名多值表单的详解
Jun 08 PHP
php抓取页面的几种方法详解
Jun 17 PHP
php读取远程gzip压缩网页的方法
Dec 29 PHP
Thinkphp模板标签if和eq的区别和比较实例分析
Jul 01 PHP
解决php的“It is not safe to rely on the system’s timezone settings”问题
Oct 08 PHP
Zend Framework教程之Zend_Form组件实现表单提交并显示错误提示的方法
Mar 21 PHP
使用PHPMailer发送邮件实例
Feb 15 PHP
ThinkPHP3.2框架使用addAll()批量插入数据的方法
Mar 16 PHP
laravel框架中控制器的创建和使用方法分析
Nov 23 PHP
BBS(php &amp; mysql)完整版(三)
Oct 09 #PHP
将数字格式的计算结果转为汉字格式
Oct 09 #PHP
透析PHP的配置文件php.ini
Oct 09 #PHP
一个简单的自动发送邮件系统(三)
Oct 09 #PHP
一个简单的自动发送邮件系统(一)
Oct 09 #PHP
一个简单的自动发送邮件系统(二)
Oct 09 #PHP
通过html表格发电子邮件
Oct 09 #PHP
You might like
我的论坛源代码(十)
2006/10/09 PHP
php skymvc 一款轻量、简单的php
2011/06/28 PHP
PHP flock 文件锁详细介绍
2012/12/29 PHP
PHP实现生成唯一会员卡号
2015/08/24 PHP
php实现映射操作实例详解
2019/10/02 PHP
laravel5.6框架操作数据curd写法(查询构建器)实例分析
2020/01/26 PHP
JavaScript 字符串连接性能优化
2008/12/20 Javascript
js 鼠标点击事件及其它捕获
2009/06/04 Javascript
js中将HTMLCollection/NodeList/伪数组转换成数组的代码
2011/07/31 Javascript
关于jQuery中的each方法(jQuery到底干了什么)
2014/03/05 Javascript
js中window.open打开一个新的页面
2014/08/10 Javascript
js实现4个方向滚动的球
2017/03/06 Javascript
angular.JS实现网页禁用调试、复制和剪切
2017/03/31 Javascript
Vue-cli-webpack搭建斗鱼直播步骤详解
2017/11/17 Javascript
three.js中文文档学习之如何本地运行详解
2017/11/20 Javascript
微信小程序常见页面跳转操作简单示例
2019/05/01 Javascript
pm2发布node配置文件ecosystem.json详解
2019/05/15 Javascript
jquery实现Ajax请求的几种常见方式总结
2019/05/28 jQuery
NodeJs crypto加密制作token的实现代码
2019/11/15 NodeJs
javascript实现留言板功能
2020/02/08 Javascript
[03:55]2016国际邀请赛中国区预选赛首日TOP10精彩集锦
2016/06/27 DOTA
python3 破解 geetest(极验)的滑块验证码功能
2018/02/24 Python
浅谈python中np.array的shape( ,)与( ,1)的区别
2018/06/04 Python
python矩阵转换为一维数组的实例
2018/06/05 Python
Python循环中else,break和continue的用法实例详解
2019/07/11 Python
Python 正则表达式爬虫使用案例解析
2019/09/23 Python
使用豆瓣源来安装python中的第三方库方法
2021/01/26 Python
大型营销活动计划书
2014/04/28 职场文书
论文诚信承诺书
2014/05/23 职场文书
媒体宣传策划方案
2014/05/25 职场文书
房展策划方案
2014/06/07 职场文书
法院反腐倡廉心得体会
2014/09/09 职场文书
单位考核鉴定意见
2015/06/05 职场文书
少先队大队委竞选口号
2015/12/25 职场文书
Python pygame实现中国象棋单机版源码
2021/06/20 Python
通过T-SQL语句创建游标与实现数据库加解密功能
2022/03/16 SQL Server