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脚本的10个技巧(3)
Oct 09 PHP
PHP与javascript的两种交互方式
Oct 09 PHP
php 表单数据的获取代码
Mar 10 PHP
PHP 读取文件内容代码(txt,js等)
Dec 06 PHP
PHP安全性漫谈
Jun 28 PHP
关于UEditor编辑器远程图片上传失败的解决办法
Aug 31 PHP
php中DOMElement操作xml文档实例演示
Mar 26 PHP
PHP查找与搜索数组元素方法总结
Jun 12 PHP
Redis构建分布式锁
Mar 28 PHP
PHP设计模式之模板模式定义与用法详解
Dec 20 PHP
laravel-admin select框默认选中的方法
Oct 03 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汉字转拼音的示例
2014/02/27 PHP
Thinkphp框架中D方法与M方法的区别
2016/12/23 PHP
PHP编程实现csv文件导入mysql数据库的方法
2017/04/29 PHP
Javascript attachEvent传递参数的办法
2009/12/14 Javascript
基于jQuery的可以控制左右滚动及自动滚动效果的代码
2010/07/25 Javascript
使用jQuery UI的tooltip函数修饰title属性的气泡悬浮框
2013/06/24 Javascript
Javascript中查找不以XX字符结尾的单词示例代码
2013/10/15 Javascript
21个JavaScript事件(Events)属性汇总
2014/12/02 Javascript
javascript实现tab切换的四种方法
2015/11/05 Javascript
JavaScript中Textarea滚动条不能拖动的解决方法
2015/12/15 Javascript
JQuery ztree 异步加载实例讲解
2016/02/25 Javascript
js改变style样式和css样式的简单实例
2016/06/28 Javascript
js判断所有表单项不为空则提交表单的实现方法
2016/09/09 Javascript
Angularjs实现搜索关键字高亮显示效果
2017/01/17 Javascript
源码分析Vue.js的监听实现教程
2017/04/23 Javascript
JS实现马赛克图片效果完整示例
2019/04/13 Javascript
js获取对象,数组所有属性键值(key)和对应值(value)的方法示例
2019/06/19 Javascript
vue结合el-upload实现腾讯云视频上传功能
2020/07/01 Javascript
python实现在字符串中查找子字符串的方法
2015/07/11 Python
Python书单 不将就
2017/07/11 Python
用matplotlib画等高线图详解
2017/12/14 Python
PyTorch 1.0 正式版已经发布了
2018/12/13 Python
windows下搭建python scrapy爬虫框架步骤
2018/12/23 Python
python快排算法详解
2019/03/04 Python
Python实现的对一个数进行因式分解操作示例
2019/06/27 Python
python mysql自增字段AUTO_INCREMENT值的修改方式
2020/05/18 Python
python怎么对数字进行过滤
2020/07/05 Python
Django跨域请求原理及实现代码
2020/11/14 Python
金宝贝童装官网:Gymboree
2016/08/31 全球购物
几个Shell Script面试题
2012/08/31 面试题
硅酸盐工业控制专业应届生求职信
2013/11/02 职场文书
销售工作人员的自我评价分享
2013/11/10 职场文书
大学生表扬信范文
2014/01/09 职场文书
群众路线教育实践活动学习笔记内容
2014/11/06 职场文书
《植物妈妈有办法》教学反思
2016/02/23 职场文书
剑指Offer之Java算法习题精讲二叉树的构造和遍历
2022/03/21 Java/Android