您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
一个模仿oso的论坛程序(之二)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:36:14
程序二:addforum.php

<html>
<head>
<link rel="STYLESHEET" type="text/css" href="fp_zhangcg.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Microsoft Theme" content="none">
<meta name="Microsoft Border" content="none">
<title>发表信息</title>
</head>
<body bgcolor="#C0C0C0" background="backcolor.gif">
<SCRIPT language=JavaScript>
<!--
  var submitcount=0;
  function checkSubmit() {
    if (submitcount == 0)  
    {
       submitcount++;    
       return true;
    }  
    else {
       if (submitcount>0){   
           alert("帖子已成功提交,请勿重复发帖!nDon't submit the form twice, please.");            return false;
       }
    }
  }
  function check_com(){
     if (document.form.username.value.length == 0){
         submitcount--;
         alert("请输入您的网上大名!nPlease input your user name.");
         return false;
     }
     if (document.form.forumtitle.value.length ==0){
         submitcount--;
         alert("主题不能为空!nYou must supply a subject.");
         return false;
     }
     if (document.form.forumcontent.value.length == 0){
        submitcount--;
        alert("加贴内容不能为空!nYou must supply a message.");
        return false;  
     }   
     return true;
}
//-->
</SCRIPT>

<?
  include ("c:mydbheader.inc");
?>


<?
if (empty($theme_id))  {
   $theme_id = 0;
  }
?>

<table width="750" border="0">
  <tr>
  <?
    if ($theme_id == 0 ) {
      print ' <td class="text">当前位置:主页??论坛??发表论坛</td>';
    }  
    else
    {
      print ' <td class="text">当前位置:主页??论坛??回复帖子</td>';
    }
  ?>
    <td>&nbsp;</td>
  </tr>
</table>
<?
print '<form action="readforum.php?readflag=0 " ';
print ' method=post name=form   onsubmit="return check_com()">';

?>
  <table width="750" border="0">
    <tr>  
      <td width="131" class="text">  
        <div align="right"><span class="text"><span class="text">您的大</span>名:</span></div>
      </td>
      <td width="609">  
        <input type="text" name="username" size="80" value="" maxlength="12">
        <font color="#ff0000">*</font> </td>
    </tr>
    <tr>  
      <td width="131" class="text">  
        <div align="right">E_mail:</div>
      </td>
      <td width="609">  
        <input type="text" name="useremail" size="80">
      </td>
    </tr>
    <tr>  
      <td width="131" class="text">  
        <div align="right">你的主页:</div>
      </td>
      <td width="609">  
        <p>  
          <input type="text" name="userhttp" size="80" value="http://">
        </p>
      </td>
    </tr>
    <tr>  
      <td width="131" class="text">  
      <?
        if ($theme_id == 0 ) {
           print ' <div align="right">加帖标题:</div>';
           print ' </td> <td width="609"> ';
           print ' <input type="text" name="forumtitle" size="80">';
           print '<input type="hidden" name="theme_id" value="0">';
           print '  <font color="#ff0000">*</font> </td>';
        } else {
           $dbh =  mysql_connect('localhost:3306','root',');
           mysql_select_db('test');  
           $tempstr = " select title from fr_t_forumtitle where id = ".$theme_id;
           $res=mysql_query($tempstr,$dbh);   
           $row=mysql_fetch_array($res);   
           print ' <div align="right">回帖标题:</div>';
           print ' </td> <td width="609"> ';
           print ' <font color="#ff0000">'.$row["title"].'</font>';
           print ' <input type="hidden" name="theme_id" value="'.$theme_id.'">';
           print ' <input type="hidden" name="forumtitle" value="e">';  //判断使用
           print ' </td>';
       }

     ?>
    </tr>
    <tr>  
      <td width="131" class="text">  
        <div align="right">表情图标:</div>
      </td>
      <td width="609">  
        <p>  
          <input type="radio" name="forumface" value="1" checked>
          <img src="icon1.gif" width="18" height="18">  
          <input type="radio" name="forumface" value="2">
          <img src="icon2.gif" width="18" height="18">  
          <input type="radio" name="forumface" value="3">
   &nbs

[1] [2] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |