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

所属分类: 网络编程 / PHP编程 阅读数: 1990
收藏 0 赞 0 分享
//此页面为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 "&nbsp;&nbsp;".$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 "&nbsp;&nbsp;".$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>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
更多精彩内容其他人还在看

CI框架实现创建自定义类库的方法

这篇文章主要介绍了CI框架实现创建自定义类库的方法,结合实例形式分析了CI框架创建自定义类库的相关原理、步骤、实现方法与操作注意事项,需要的朋友可以参考下
收藏 0 赞 0 分享

Yii2.0 RESTful API 基础配置教程详解

这篇文章主要介绍了Yii2.0 RESTful API 基础配置教程,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

CI框架附属类用法分析

这篇文章主要介绍了CI框架附属类用法,结合实例形式分析了CI框架附属类相关资源访问操作技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

CI框架网页缓存简单用法分析

这篇文章主要介绍了CI框架网页缓存简单用法,结合实例形式分析了CI框架网页缓存的原理,以及开启缓存、删除缓存等操作技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

php实现的PDO异常处理操作分析

这篇文章主要介绍了php实现的PDO异常处理操作,结合实例形式分析了pdo异常处理的相关原理、用法及操作注意事项,需要的朋友可以参考下
收藏 0 赞 0 分享

php PDO属性设置与操作方法分析

这篇文章主要介绍了php PDO属性设置与操作方法,结合实例形式分析了php pdo常见属性功能及相关的设置、获取操作技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

PHP抽象类基本用法示例

这篇文章主要介绍了PHP抽象类基本用法,结合实例形式分析了php抽象类的概念、原理、定义、使用方法及相关操作注意事项,代码注释包含较为详尽的说明信息,需要的朋友可以参考下
收藏 0 赞 0 分享

PHP面向对象程序设计继承用法简单示例

这篇文章主要介绍了PHP面向对象程序设计继承用法,结合具体实例形式分析了php面向对象程序设计中继承的相关概念、原理、使用技巧与相关操作注意事项,需要的朋友可以参考下
收藏 0 赞 0 分享

PHP实现函数内修改外部变量值的方法示例

这篇文章主要介绍了PHP实现函数内修改外部变量值的方法,涉及php全局变量、传值调用、引用等相关操作技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

PHP命名空间简单用法示例

这篇文章主要介绍了PHP命名空间简单用法,结合具体实例形式分析了php命名空间的简单定义与使用相关操作技巧,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多