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 相关文章推荐
PHP面向对象编程快速入门
Dec 14 PHP
php中json_encode中文编码问题分析
Sep 13 PHP
php rsa加密解密使用详解
Jan 14 PHP
PHP CURL 内存泄露问题解决方法
Feb 12 PHP
php curl 上传文件代码实例
Apr 27 PHP
服务器迁移php版本不同可能诱发的问题
Dec 22 PHP
YII Framework教程之异常处理详解
Mar 14 PHP
基于thinkPHP类的插入数据库操作功能示例
Jan 06 PHP
php图形jpgraph操作实例分析
Feb 22 PHP
老生常谈PHP 文件写入和读取(必看篇)
May 22 PHP
PHP面向对象程序设计__tostring()和__invoke()用法分析
Jun 12 PHP
基于laravel-admin 后台 列表标签背景的使用方法
Oct 03 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
在线竞拍系统的PHP实现框架(一)
2006/10/09 PHP
编写PHP的安全策略
2006/10/09 PHP
php支付宝手机网页支付类实例
2015/03/04 PHP
php将金额数字转化为中文大写
2015/07/09 PHP
php获取错误信息的方法
2015/07/17 PHP
非常全面的php日期时间运算汇总
2015/11/04 PHP
php生成毫秒时间戳的实例讲解
2017/09/22 PHP
javascript常用方法总结
2015/05/14 Javascript
JavaScript知识点总结(五)之Javascript中两个等于号(==)和三个等于号(===)的区别
2016/05/31 Javascript
基于BootStrap环境写jQuery tabs插件
2016/07/12 Javascript
Bootstrap的modal拖动效果
2016/12/25 Javascript
js实现简单的网页换肤效果
2017/01/18 Javascript
Node.js连接MongoDB数据库产生的问题
2017/02/08 Javascript
用node和express连接mysql实现登录注册的实现代码
2017/07/05 Javascript
如何用webpack4带你实现一个vue的打包的项目
2018/06/20 Javascript
Layui实现数据表格默认全部显示(不要分页)
2019/10/26 Javascript
[01:55]2014DOTA2国际邀请赛快报:国土生病 紧急去医院治疗
2014/07/10 DOTA
[01:14]DOTA2亚洲邀请赛 ShowOpen
2015/02/07 DOTA
Python函数返回值实例分析
2015/06/08 Python
python实现鸢尾花三种聚类算法(K-means,AGNES,DBScan)
2019/06/27 Python
Django使用模板后无法找到静态资源文件问题解决
2019/07/19 Python
使用 Supervisor 监控 Python3 进程方式
2019/12/05 Python
Python list运算操作代码实例解析
2020/01/20 Python
解决ROC曲线画出来只有一个点的问题
2020/02/28 Python
Python 如何创建一个线程池
2020/07/28 Python
python利用pytesseract 实现本地识别图片文字
2020/12/14 Python
Columbia美国官网:美国著名的户外服装品牌
2016/11/24 全球购物
美国沃尔玛网上超市:Walmart
2020/08/14 全球购物
优纳科技软件测试面试题
2012/05/15 面试题
小学教研工作制度
2014/01/15 职场文书
开展批评与自我批评心得体会
2014/10/17 职场文书
孔庙导游词
2015/02/04 职场文书
黑暗中的舞者观后感
2015/06/18 职场文书
个人催款函范文
2015/06/24 职场文书
OpenCV-Python实现图像平滑处理操作
2021/06/08 Python
浅谈Python3中datetime不同时区转换介绍与踩坑
2021/08/02 Python