当前位置: 首页 > 图文教程 > 网络编程 > PHP > 一个模仿oso的php论坛程序源码(之二)

PHP
php面向对象全攻略 (十五) 多态的应用
php面向对象全攻略 (十六) 对象的串行化
php面向对象全攻略 (十七) 自动加载类
PHP parse_url 一个好用的函数
PHP 字符串分割和比较
全世界最小的php网页木马一枚 附PHP木马的防范方法
PHP 日期加减的类,很不错
PHP 日期时间函数的高级应用技巧
PHP获取163、gmail、126等邮箱联系人地址【已测试2009.10.10】
Ha0k 0.3 PHP 网页木马修改版
PHP iconv 函数转gb2312的bug解决方法
关于页面优化和伪静态
使用zend studio for eclipse不能激活代码提示功能的解决办法
PHP 身份验证方面的函数
基于OpenCV的PHP图像人脸识别技术
用mysql触发器自动更新memcache的实现代码
php 数学运算验证码实现代码
PHP网站开发方案实例
PHP教程:挖掘细节提升网站性能
搜索引擎技术核心揭密(PHP)

PHP 中的 一个模仿oso的php论坛程序源码(之二)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 173 ::
收藏到网摘: n/a

程序二: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="/upload/tech/20091012/20091012014142_48ab2f9b45957ab574cf005eb8a76760.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> </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="/upload/tech/20091012/20091012014146_d240e3d38a8882ecad8633c8f9c78c9b.gif" width="18" height="18">
<input type="radio" name="forumface" value="2">
<img src="/upload/tech/20091012/20091012014146_57aeee35c98205091e18d1140e9f38cf.gif" width="18" height="18">
<input type="radio" name="forumface" value="3">
<img src="/upload/tech/20091012/20091012014147_b7bb35b9c6ca2aee2df08cf09d7016c2.gif" width="18" height="18">
<input type="radio" name="forumface" value="4">
<img src="/upload/tech/20091012/20091012014147_a1d0c6e83f027327d8461063f4ac58a6.gif" width="18" height="18">
<input type="radio" name="forumface" value="5">
<img src="/upload/tech/20091012/20091012014148_3295c76acbf4caaed33c36b1b5fc2cb1.gif" width="18" height="18">
<input type="radio" name="forumface" value="6">
<img src="/upload/tech/20091012/20091012014148_9c838d2e45b2ad1094d42f4ef36764f6.gif" width="18" height="18">
<input type="radio" name="forumface" value="7">
<img src="/upload/tech/20091012/20091012014149_39461a19e9eddfb385ea76b26521ea48.gif" width="18" height="18"><br>
<input type="radio" name="forumface" value="8">
<img src="/upload/tech/20091012/20091012014149_38af86134b65d0f10fe33d30dd76442e.gif" width="18" height="18">
<input type="radio" name="forumface" value="9">
<img src="/upload/tech/20091012/20091012014150_496e05e1aea0a9c4655800e8a7b9ea28.gif" width="18" height="18">
<input type="radio" name="forumface" value="10">
<img src="/upload/tech/20091012/20091012014150_7750ca3559e5b8e1f44210283368fc16.gif" width="18" height="18">
<input type="radio" name="forumface" value="11">
<img src="/upload/tech/20091012/20091012014151_7504adad8bb96320eb3afdd4df6e1f60.gif" width="18" height="18">
<input type="radio" name="forumface" value="12">
<img src="/upload/tech/20091012/20091012014154_0b8aff0438617c055eb55f0ba5d226fa.gif" width="18" height="18">
<input type="radio" name="forumface" value="13">
<img src="/upload/tech/20091012/20091012014157_8f121ce07d74717e0b1f21d122e04521.gif" width="18" height="18">
<input type="radio" name="forumface" value="14">
<img src="/upload/tech/20091012/20091012014157_c4015b7f368e6b4871809f49debe0579.gif" width="18" height="18"></p>
</td>
</tr>
<tr>

<td width="131" valign="top" height="30" class="text">
<div align="right">加贴内容:</div>
</td>
<td width="609" valign="top" height="30">
<textarea name="forumcontent" cols="80" rows="6"></textarea>
</td>
</tr>
<tr>
<td width="131" valign="top"></td>
</td>
<td width="609" valign="top">
<input type="submit" name="Submit" onclick="return checkSubmit()" value="提交">

<input type="reset" name="Submit2" value="清除">
</td>
</tr>
</table>
</form>
<p><span class="text">请您注意: <br>
<font color="#ff0000">*</font> 您的大名,加帖标题不能为空<br>
<font color="#ff0000">* </font>尊重网上道德,遵守中华人民共和国的各项有关法律法规 <br>
<font color="#ff0000">* </font>承担一切因您的行为而直接或间接导致的民事或刑事法律责任 <br>
<font color="#ff0000">*</font> 参与本论坛即表明您已经阅读并接受上述条款 <br>
</span> </p>
<?
include ("c:mydbfooter.inc");
?>
<p><span class="text"> </span></p>
</body>
</html>
-----------------------
http://zhangcg.yeah.net