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 21 PHP
PHP的cURL库功能简介 抓取网页、POST数据及其他
Apr 07 PHP
Pain 全世界最小最简单的PHP模板引擎 (普通版)
Oct 23 PHP
php class中self,parent,this的区别以及实例介绍
Apr 24 PHP
解析PHP中的正则表达式以及模式匹配
Jun 19 PHP
浅析PHP中Collection 类的设计
Jun 21 PHP
php对数组排序代码分享
Feb 24 PHP
PHP数组排序之sort、asort与ksort用法实例
Sep 08 PHP
php通过执行CutyCapt命令实现网页截图的方法
Sep 30 PHP
PHP实现原生态图片上传封装类方法
Nov 08 PHP
Laravel中日期时间处理包Carbon的简单使用
Sep 21 PHP
thinkPHP中U方法加密传递参数功能示例
May 29 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&amp;&amp;mysql)三
2006/10/09 PHP
关于Intype一些小问题的解决办法
2008/03/28 PHP
php minixml详解
2008/07/19 PHP
php 变量未定义等错误的解决方法
2011/01/12 PHP
解析php做推送服务端实现ios消息推送
2013/07/01 PHP
php+ajax 实现输入读取数据库显示匹配信息
2015/10/08 PHP
PHP中非常有用却鲜有人知的函数集锦
2019/08/17 PHP
在thinkphp5.0路径中实现去除index.php的方式
2019/10/16 PHP
PHP优化之批量操作MySQL实例分析
2020/04/23 PHP
javascript中使用replaceAll()函数实现字符替换的方法
2010/12/25 Javascript
jQuery布局插件UI Layout简介及使用方法
2013/04/03 Javascript
Jquery实现图片预加载与延时加载的方法
2014/12/22 Javascript
基于jquery实现放大镜效果
2015/08/17 Javascript
详谈Ajax请求中的async:false/true的作用(ajax 在外部调用问题)
2017/02/10 Javascript
如何理解Vue的作用域插槽的实现原理
2017/08/19 Javascript
jQuery实现模糊搜索功能的方法分析
2018/06/29 jQuery
解决vue-quill-editor上传内容由于图片是base64的导致字符太长的问题
2018/08/20 Javascript
vue和better-scroll实现列表左右联动效果详解
2019/04/29 Javascript
vue+element 实现商城主题开发的示例代码
2020/03/26 Javascript
Python的dict字典结构操作方法学习笔记
2016/05/07 Python
举例讲解Python面向对象编程中类的继承
2016/06/17 Python
Django+Ajax+jQuery实现网页动态更新的实例
2018/05/28 Python
实例详解Python装饰器与闭包
2019/07/29 Python
浅谈python之自动化运维(Paramiko)
2020/01/31 Python
基于python-pptx库中文文档及使用详解
2020/02/14 Python
Python基于pandas爬取网页表格数据
2020/05/11 Python
python调用私有属性的方法总结
2020/07/24 Python
python 爬取免费简历模板网站的示例
2020/09/27 Python
关于 HTML5 的七个传说小结
2012/04/12 HTML / CSS
使用Vue.js和MJML创建响应式电子邮件
2021/03/23 Vue.js
大学军训感言300字
2014/03/09 职场文书
2014年五四青年节活动方案
2014/03/29 职场文书
基层党员对照检查材料
2014/08/25 职场文书
一年级班主任工作总结2014
2014/11/08 职场文书
2015年教育实习工作总结
2015/04/24 职场文书
公司业务员管理制度
2015/08/05 职场文书