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 相关文章推荐
PHP4之COOKIE支持详解
Oct 09 PHP
解析PHP缓存函数的使用说明
May 10 PHP
基于php常用函数总结(数组,字符串,时间,文件操作)
Jun 27 PHP
5种PHP创建数组的实例代码分享
Jan 17 PHP
php 使用GD库为页面增加水印示例代码
Mar 24 PHP
dedecms集成财付通支付接口
Dec 28 PHP
制作安全性高的PHP网站的几个实用要点
Dec 30 PHP
Zend Framework教程之资源(Resources)用法实例详解
Mar 14 PHP
php简单获取复选框值的方法
May 11 PHP
laravel 5.4 + vue + vux + element的环境搭配过程介绍
Apr 26 PHP
thinkPHP+LayUI 流加载实现功能
Sep 27 PHP
Laravel开启跨域请求的方法
Oct 13 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 文件扩展名 获取函数
2009/06/03 PHP
php判断当前用户已在别处登录的方法
2015/01/06 PHP
PHP中实现接收多个name相同但Value不相同表单数据实例
2015/02/03 PHP
PHP动态地创建属性和方法, 对象的复制, 对象的比较,加载指定的文件,自动加载类文件,命名空间
2016/05/06 PHP
Centos6.5和Centos7 php环境搭建方法
2016/05/27 PHP
PHP树-不需要递归的实现方法
2016/06/21 PHP
php+layui数据表格实现数据分页渲染代码
2019/10/26 PHP
用JavaScript实现单继承和多继承的简单方法
2009/03/29 Javascript
异步javascript的原理和实现技巧介绍
2012/11/08 Javascript
使用js判断控件是否获得焦点
2014/01/03 Javascript
可自定义速度的js图片无缝滚动示例分享
2014/01/20 Javascript
js和jquery使按钮失效为不可用状态的方法
2014/01/26 Javascript
javascript初学者常用技巧
2014/09/02 Javascript
JavaScript中的getMilliseconds()方法使用详解
2015/06/10 Javascript
jquery悬浮提示框完整实例
2016/01/13 Javascript
jQuery遍历DOM节点操作之filter()方法详解
2016/04/14 Javascript
JavaScript实现清空(重置)文件类型INPUT元素值的方法
2016/11/17 Javascript
NPM 安装cordova时警告:npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to
2016/12/20 Javascript
js图片加载效果实例代码(延迟加载+瀑布流加载)
2017/05/12 Javascript
详解vue-cli开发环境跨域问题解决方案
2017/06/06 Javascript
原生js封装添加class,删除class的实例
2017/11/06 Javascript
three.js加载obj模型的实例代码
2017/11/10 Javascript
分享5个小技巧让你写出更好的 JavaScript 条件语句
2018/10/20 Javascript
Vue axios 跨域请求无法带上cookie的解决
2020/09/08 Javascript
解决vue与node模版引擎的渲染标记{{}}(双花括号)冲突问题
2020/09/11 Javascript
Python使用Mechanize模块编写爬虫的要点解析
2016/03/31 Python
Python安装Numpy和matplotlib的方法(推荐)
2017/11/02 Python
漂亮的Django Markdown富文本app插件的实现
2019/01/02 Python
python 元组和列表的区别
2020/12/30 Python
x-ua-compatible content=”IE=7, IE=9″意思理解
2013/07/22 HTML / CSS
前端使用canvas生成盲水印的加密解密的实现
2020/12/16 HTML / CSS
英国最大的海报商店:GB Posters
2018/03/20 全球购物
安全教育月活动总结
2014/05/05 职场文书
给上级领导的感谢信
2015/01/22 职场文书
Oracle创建只读账号的详细步骤
2021/06/07 Oracle
Win11任务栏无法正常显示 资源管理器不停重启的解决方法
2022/07/07 数码科技