欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-08-11 15:49:20
//此页面为look.php
//此页面为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>