首页 >> 读书频道 >> 电脑 >> 模仿OSO的论坛(四)
 
· 模仿OSO的论坛(五)
· 用PHP和ACCESS写
· 用PHP和ACCESS写
· 用PHP和ACCESS写
· 用php+mysql一个
· 我的群发邮件程序
· php上传、管理照片示例
· 在PHP3中实现SESS
· 在PHP3中实现SESS
· 在PHP3中实现SESS
· 我用php+mysql写
· 一个简洁的多级别论坛
 
· 美容养颜手册
· 加油金顺剧情分集介绍完整
· 红楼梦:120回全本[清
· 素质教育在美国
· 全唐诗卷四十六
· 韩剧《布拉格恋人》剧情介
· 夜航船[作者:明·张岱]
· 局外人[作者:韩·可爱淘
· 现场流行病学
· 源氏物语[日本:紫式部]
· 武林寓言故事
· 2006高考录取规则
 
· (出租)中动商场部分及写
· (出租)中动动漫基地&#
· 喜剧学院
· 《善德女王》剧情介绍
· 魔女18号 剧情
· 丑女无敌剧情介绍
· 魔女幼熙剧情介绍
· 龙游天下剧情介绍
· 震撼世界的七日剧情介绍
· 静静的白桦林剧情介绍
· 心情日记—老公今天我想对
· 旗舰剧情介绍
欢迎来到月影社区!如果您觉得这里不错,请推荐给您的朋友们。月影社区:http://wf66.com/

模仿OSO的论坛(四)


查看有无更新版本

关键字:PHP 2006-9-4

 

reply.php(用来回复主题)
<HTML><HEAD><TITLE>疑难问题</TITLE>
<LINK href="mypic/style.css" rel=STYLESHEET type=text/css></HEAD>
<?php
if (!$cook_user)
{echo "<script language='javascript'>"; 
echo "parent.location.href='index.php'"; 
echo "</script>";}
else {include ("connect.inc.php");
$query = "select * from my_user where user='".$cook_user."' and password='".$cook_password."'"; 
$res = mysql_query($query); 
if (!$res)
{echo "<script language='javascript'>"; 
echo "parent.location.href='index.php'"; 
echo "</script>";}
include "connect.inc.php";
if ($content) {$content= str_replace ( "'","mysinglequotes",$content); 
$content=htmlspecialchars($content);
$content=nl2br($content);
$query = "INSERT INTO guestbook (name,type,content,icon,time_open,time_close,answer_count,answer_name,main_id) VALUES ('".$cook_user."',0,'".$content."',".$icon.",now(),now(),1,'".$cook_user."',".$theme_id.")"; 
$res = mysql_query($query);
if ($res) 
{$query = "update guestbook set time_close=now(),answer_count=answer_count+1,answer_name='".$cook_user."' where id=".$theme_id; 
$res = mysql_query($query); 
if ($res)
{echo "<script language='javascript'>"; 
echo "parent.location.href='post_end.php'";
echo "</script>";}}}}
?>
<script language=Javascript>
<!--
var submitcount=0;
function check_com(){
   if(document.form.theme.value.length ==0){
      submitcount--;
      alert("主题不能为空!nYou must supply a subject.");
      return false;
   }
   if(document.form.content.value.length == 0){
      submitcount--;
      alert("加贴内容不能为空!nYou must supply a message.");
      return false;
   }
   return true;
}
//-->
</script>
<BODY bgColor=#cccc99 bottomMargin=0 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<form method="post" action="reply.php" name="form" onSubmit="return check_com()">
<script language=Javascript 
src="mypic/x.js"></script>
  <TR>
    <TD vAlign=top>
      <TABLE align=center border=0 cellPadding=4 cellSpacing=0 width=100%>
        <TBODY>
        <TR>
          <TD class=mid width=20%>回复主题<BR><BR></TD>
          <TD class=mid><A class=title 
            href="read.php?theme_id=<?php echo $theme_id ?>">
<?php 
$query = "select theme from guestbook where id=".$theme_id;
$res = mysql_query($query); 
$row = mysql_fetch_row($res); 
echo $row[0];
?>
</A><BR><BR></TD></TR>
        <TR>
          <TD class=mid vAlign=top>表情图标</TD>
          <TD><INPUT CHECKED name=icon type=radio value=1> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon1.gif" 
            width=18><INPUT name=icon type=radio value=2> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon2.gif" 
            width=18><INPUT name=icon type=radio value=3> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon3.gif" 
            width=18><INPUT name=icon type=radio value=4> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon4.gif" 
            width=18><INPUT name=icon type=radio value=5> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon5.gif" 
            width=18><INPUT name=icon type=radio value=6> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon6.gif" 
            width=18><INPUT name=icon type=radio value=7> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon7.gif" 
            width=18><BR><INPUT name=icon type=radio value=8> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon8.gif" 
            width=18><INPUT name=icon type=radio value=9> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon9.gif" 
            width=18><INPUT name=icon type=radio value=10> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon10.gif" 
            width=18><INPUT name=icon type=radio value=11> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon11.gif" 
            width=18><INPUT name=icon type=radio value=12> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon12.gif" 
            width=18><INPUT name=icon type=radio value=13> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon13.gif" 
            width=18><INPUT name=icon type=radio value=14> <IMG 
            align=ABSCENTER height=18 
            src="http://www.7880.com/Info/mypic/icon14.gif" 
            width=18></TD></TR>
        <TR>
          <TD class=mid vAlign=top><input type="hidden" name="theme_id" size="12" class="stedit" value="<?php echo $theme_id ?>">
          加贴内容</TD>
          <TD><TEXTAREA cols=50 name=content rows=6></TEXTAREA> </TD></TR>
        <TR>
          <TD> </TD>
          <TD><INPUT name=submit onclick="return checkSubmit()" type=submit value=" 发 表 "> 
                   <INPUT name=reset type=reset value=" 清 除 "> </TD></TR>
               </FORM>
        <TR>
          <TD colSpan=2><BR><BR><FONT color=#797979>
            <LI>本主题最后 5 个帖子 (按发帖时间倒序排列)</FONT></LI></TD></TR></TBODY></TABLE>
      <TABLE align=center bgColor=#000000 border=0 cellPadding=4 cellSpacing=1 
      width=100%>
        <TBODY>
        <TR bgColor=#666666>
          <TD width="10%"><FONT color=#ffffff>作 者</FONT></TD>
          <TD width="90%"><FONT color=#ffffff>内 容</FONT></TD></TR>
<?php
$query = "select * from guestbook where main_id=".$theme_id." or id=".$theme_id." order by time_open DESC limit 5 ";
$res = mysql_query($query); 
function TdBackColor() {
  static $ColorStr;
  if ($ColorStr=="#ededed") {
    $ColorStr="#dedede";
  } else {
    $ColorStr="#ededed";
  }
  return($ColorStr);
}
for ($i=1;$i<=5;$i++)
{$row = @mysql_fetch_array($res); 
if (!$row) break; 
$ColorStr=TdBackColor();
echo "<TR bgColor=".$ColorStr.">";
echo "<TD vAlign=top>".$row['name']."</td>"; 
$content= str_replace ( "mysinglequotes","'",$row['content']); 
echo "<td>".$content."</td></tr>"; 
}
?>     
</TBODY></TABLE>
</TBODY></TABLE>
</FORM>
</html> 

模仿OSO的论坛(四)

[ 1 ]
模仿OSO的论坛(四) num

打印本页 关闭

关于我们版权声明本站导航友情连结作品演示 TOP↑