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 相关文章推荐
mysql 搜索之简单应用
Apr 27 PHP
PHP写入WRITE编码为UTF8的文件的实现代码
Jul 07 PHP
php自动跳转中英文页面
Jul 29 PHP
解析PHP中一些可能会被忽略的问题
Jun 21 PHP
PHP错误WARNING: SESSION_START() [FUNCTION.SESSION-START]解决方法
May 04 PHP
php计算两个坐标(经度,纬度)之间距离的方法
Apr 17 PHP
PHP加密解密类实例分析
Apr 20 PHP
培养自己的php编码规范
Sep 28 PHP
PHP的数组中提高元素查找与元素去重的效率的技巧解析
Mar 03 PHP
PHP针对多用户实现更换头像功能
Sep 04 PHP
form自动提交实例讲解
Jul 10 PHP
php实现网页端验证码功能
Jul 11 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接口中interface存在的意义
2013/06/27 PHP
php使用Jpgraph绘制柱形图的方法
2015/06/10 PHP
php实现比较两个文件夹异同的方法
2015/06/18 PHP
PHP Smarty模版简单使用方法
2016/03/30 PHP
解决laravel id非自增 模型取回为0 的问题
2019/10/11 PHP
用JQuery 判断某个属性是否存在hasAttr的解决方法
2013/04/26 Javascript
javascript实现颜色渐变的方法
2013/10/30 Javascript
js实现文章文字大小字号功能完整实例
2014/11/01 Javascript
jQuery带箭头提示框tooltips插件集锦
2014/11/17 Javascript
Angular.JS学习之依赖注入$injector详析
2016/10/20 Javascript
使用JavaScript解决网页图片拉伸问题(推荐)
2016/11/25 Javascript
javascript深拷贝和浅拷贝详解
2017/02/14 Javascript
jquery实现图片上传前本地预览
2017/04/28 jQuery
vuex 解决报错this.$store.commit is not a function的方法
2018/12/17 Javascript
JavaScript函数式编程(Functional Programming)箭头函数(Arrow functions)用法分析
2019/05/22 Javascript
javascript实现下拉菜单效果
2021/02/09 Javascript
在Django中创建第一个静态视图
2015/07/15 Python
用Python写飞机大战游戏之pygame入门(4):获取鼠标的位置及运动
2015/11/05 Python
python中print()函数的“,”与java中System.out.print()函数中的“+”功能详解
2017/11/24 Python
python-django中的APPEND_SLASH实现方法
2019/06/21 Python
python 采用paramiko 远程执行命令及报错解决
2019/10/21 Python
pygame实现俄罗斯方块游戏(AI篇1)
2019/10/29 Python
Pandas直接读取sql脚本的方法
2021/01/21 Python
如何使用Python进行PDF图片识别OCR
2021/01/22 Python
某公司Java工程师面试题笔试题
2016/03/27 面试题
同步和异步有何异同,在什么情况下分别使用他们
2013/04/09 面试题
超市促销活动方案
2014/03/05 职场文书
党支部对照检查材料
2014/08/25 职场文书
党的群众路线个人对照检查材料
2014/09/23 职场文书
工人先锋号申报材料
2014/12/29 职场文书
南湾猴岛导游词
2015/02/09 职场文书
幸福终点站观后感
2015/06/04 职场文书
周末问候语大全
2015/11/10 职场文书
CentOS MySql8 远程连接实战
2022/04/19 MySQL
numpy array找出符合条件的数并赋值的示例代码
2022/06/01 Python
MySQL索引失效十种场景与优化方案
2023/05/08 MySQL