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 clearstatcache()函数详解
Mar 02 PHP
微盾PHP脚本加密专家php解密算法
Sep 13 PHP
深入PHP数据缓存的使用说明
May 10 PHP
PHP获取浏览器信息类和客户端地理位置的2个方法
Apr 24 PHP
PHP实现手机号码中间四位用星号(*)隐藏的自定义函数分享
Sep 27 PHP
详解在PHP的Yii框架中使用行为Behaviors的方法
Mar 18 PHP
PHP 数组基本操作小结(推荐)
Jun 13 PHP
PHP输出多个元素的排列或组合的方法
Mar 14 PHP
php安全配置记录和常见错误梳理(总结)
Mar 28 PHP
Symfony2针对输入时间进行查询的方法分析
Jun 28 PHP
Laravel中获取路由参数Route Parameters的五种方法示例
Sep 29 PHP
php创建类并调用的实例方法
Sep 25 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 strncasecmp字符串比较的小技巧
2011/01/04 PHP
Javascript-Mozilla和IE中的一个函数直接量的问题
2007/01/09 Javascript
extjs 04_grid 单击事件新发现
2012/11/27 Javascript
NodeJS使用jQuery选择器操作DOM
2015/02/13 NodeJs
JavaScript使用Math.Min返回两个数中较小数的方法
2015/04/06 Javascript
详解javascript数组去重问题
2015/11/06 Javascript
javascript性能优化之DOM交互操作实例分析
2015/12/12 Javascript
理解Javascript的call、apply
2015/12/16 Javascript
jQuery中的Deferred和promise 的区别
2016/04/03 Javascript
JavaScript实现设计模式中的单例模式的一些技巧总结
2016/05/17 Javascript
BootStrap selectpicker
2016/06/20 Javascript
javascript insertAfter()定义与用法示例
2016/07/25 Javascript
ajax的分页查询示例(不刷新页面)
2017/01/11 Javascript
深入理解javascript的getTime()方法
2017/02/16 Javascript
巧用weui.topTips验证数据的实例
2017/04/17 Javascript
Node解决简单重复问题系列之Excel内容的获取
2018/01/02 Javascript
vue-cli脚手架引入图片的几种方法总结
2018/03/13 Javascript
js中getter和setter用法实例分析
2018/08/14 Javascript
JS获取并处理php数组的方法实例分析
2018/09/04 Javascript
jQuery-Citys省市区三级菜单联动插件使用详解
2019/07/26 jQuery
ES6使用新特性Proxy实现的数据绑定功能实例
2020/05/11 Javascript
vue 全局封装loading加载教程(全局监听)
2020/11/05 Javascript
Python列表和元组的定义与使用操作示例
2017/07/26 Python
Windows下PyCharm安装图文教程
2018/08/27 Python
对Python生成汉字字库文字,以及转换为文字图片的实例详解
2019/01/29 Python
Python中的random.uniform()函数教程与实例解析
2019/03/02 Python
python自定义函数实现最大值的输出方法
2019/07/09 Python
python hough变换检测直线的实现方法
2019/07/12 Python
PyQt5.6+pycharm配置以及pyinstaller生成exe(小白教程)
2020/06/02 Python
加州风格的游泳和沙滩装品牌:Cupshe
2019/06/10 全球购物
法院干警四风问题个人对照检查材料思想汇报
2014/10/07 职场文书
2015年党员个人自我评价
2015/03/03 职场文书
师德师风培训感言
2015/08/03 职场文书
幼儿园心得体会范文
2016/01/21 职场文书
python基础之while循环语句的使用
2021/04/20 Python
JS实现页面炫酷的时钟特效示例
2022/08/14 Javascript