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+MSSQL分页的例子
Oct 09 PHP
动态生成gif格式的图像要注意?
Oct 09 PHP
关于BIG5-HKSCS的解决方法
Mar 20 PHP
php 什么是PEAR?(第二篇)
Mar 19 PHP
解决CodeIgniter伪静态失效
Jun 09 PHP
PHP+MySQL修改记录的方法
Jan 21 PHP
laravel容器延迟加载以及auth扩展详解
Mar 02 PHP
PHP的APC模块实现上传进度条
Oct 27 PHP
php实现购物车功能(以大苹果购物网为例)
Mar 09 PHP
php读取XML的常见方法实例总结
Apr 25 PHP
PHP获取当前系统时间的方法小结
Oct 03 PHP
PHP实现百度人脸识别
May 06 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+memcache实现的网站在线人数统计代码
2014/07/04 PHP
百度地图API使用方法详解
2015/08/25 PHP
js 判断脚本加载完毕的代码
2011/07/13 Javascript
JS Array.slice 截取数组的实现方法
2016/01/02 Javascript
Bootstrap CSS布局之表格
2016/12/17 Javascript
jQuery中的$是什么意思及 $. 和 $().的区别
2018/04/20 jQuery
JavaScript使用面向对象实现的拖拽功能详解
2019/06/12 Javascript
解决layui轮播图有数据不显示的情况
2019/09/16 Javascript
Vue组件为什么data必须是一个函数
2020/06/11 Javascript
Openlayers显示地理位置坐标的方法
2020/09/28 Javascript
python 中的列表解析和生成表达式
2011/03/10 Python
Python升级提示Tkinter模块找不到的解决方法
2014/08/22 Python
跟老齐学Python之赋值,简单也不简单
2014/09/24 Python
Python OpenCV读取png图像转成jpg图像存储的方法
2018/10/28 Python
python实现根据文件关键字进行切分为多个文件的示例
2018/12/10 Python
python 图像平移和旋转的实例
2019/01/10 Python
python set内置函数的具体使用
2019/07/02 Python
Numpy中对向量、矩阵的使用详解
2019/10/29 Python
使用pygame编写Flappy bird小游戏
2020/03/14 Python
Python 找出英文单词列表(list)中最长单词链
2020/12/14 Python
Python开发.exe小工具的详细步骤
2021/01/27 Python
HTML5 video 视频标签使用介绍
2014/02/03 HTML / CSS
在线服装零售商:SheIn
2016/07/22 全球购物
Luxplus瑞典:香水和美容护理折扣
2018/01/28 全球购物
如何查找网页漏洞
2016/06/22 面试题
公司行政经理岗位职责
2013/12/24 职场文书
四好少年事迹材料
2014/01/12 职场文书
财务人员担保书
2014/05/13 职场文书
宾馆前台接待岗位职责
2015/04/02 职场文书
小学语文国培研修日志
2015/11/13 职场文书
2019年房屋委托租赁合同范本(通用版)!
2019/07/17 职场文书
如何判断微信付款码和支付宝付款码
2021/04/01 PHP
解析laravel使用workerman用户交互、服务器交互
2021/04/28 PHP
MySQL系列之三 基础篇
2021/07/02 MySQL
redis击穿 雪崩 穿透超详细解决方案梳理
2022/03/17 Redis
JS函数式编程实现XDM一
2022/06/16 Javascript