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制作静态网站的模板框架(三)
Oct 09 PHP
php与php MySQL 之间的关系
Jul 17 PHP
phpcms模块开发之swfupload的使用介绍
Apr 28 PHP
PHP网页游戏学习之Xnova(ogame)源码解读(九)
Jun 24 PHP
php实现发送微信模板消息的方法
Mar 07 PHP
php实现遍历多维数组的方法
Nov 25 PHP
php编程每天必学之表单验证
Mar 01 PHP
使用正则去除php代码中的注释方法
Nov 03 PHP
php中strlen和mb_strlen用法实例分析
Nov 12 PHP
PHP框架自动加载类文件原理详解
Jun 06 PHP
php实现和c#一致的DES加密解密实例
Jul 24 PHP
对php 判断http还是https,以及获得当前url的方法详解
Jan 15 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多线程抓取网页实现代码
2010/07/22 PHP
PHP递归返回值时出现的问题解决办法
2013/02/19 PHP
PHP文件操作方法汇总
2015/07/01 PHP
PHP数组常用函数实例小结
2018/08/20 PHP
如何判断图片地址是否失效
2007/02/02 Javascript
JQuery 初体验(建议学习jquery)
2009/04/25 Javascript
文本框回车提交与禁止提交示例
2013/09/27 Javascript
原生javascript实现拖动元素示例代码
2014/09/01 Javascript
jQuery中triggerHandler()方法用法实例
2015/01/19 Javascript
js实现透明度渐变效果的方法
2015/04/10 Javascript
JQuery中节点遍历方法实例
2015/05/18 Javascript
vue.js指令v-model实现方法
2016/12/05 Javascript
详解webpack+gulp实现自动构建部署
2017/06/29 Javascript
JS运动特效之同时运动实现方法分析
2018/01/24 Javascript
解决nodejs的npm命令无反应的问题
2018/05/17 NodeJs
react在安卓中输入框被手机键盘遮挡问题的解决方法
2018/09/03 Javascript
使用jQuery给Table动态增加行、清空table的方法
2018/09/05 jQuery
axios对请求各种异常情况处理的封装方法
2018/09/25 Javascript
Vue项目服务器部署之子目录部署方法
2019/05/12 Javascript
解决前后端分离 vue+springboot 跨域 session+cookie失效问题
2019/05/13 Javascript
react实现移动端下拉菜单的示例代码
2020/01/16 Javascript
40行代码把Vue3的响应式集成进React做状态管理
2020/05/20 Javascript
[03:26]《DAC最前线》之EG经理自述DOTA2经历
2015/02/02 DOTA
python笔记(2)
2012/10/24 Python
Python的函数的一些高阶特性
2015/04/27 Python
python数据类型判断type与isinstance的区别实例解析
2017/10/31 Python
python从入门到精通 windows安装python图文教程
2019/05/18 Python
windows下Python安装、使用教程和Notepad++的使用教程
2019/10/06 Python
使用卷积神经网络(CNN)做人脸识别的示例代码
2020/03/27 Python
使用OpenCV获取图片连通域数量,并用不同颜色标记函
2020/06/04 Python
Python 绘制可视化折线图
2020/07/22 Python
领先的英国注册在线药房 :Simply Meds Online
2019/03/28 全球购物
Sisley法国希思黎中国官网:享誉全球的奢华植物美容品牌
2019/06/30 全球购物
工程力学专业毕业生求职信
2013/10/06 职场文书
搞笑征婚广告词
2014/03/17 职场文书