欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【挑战最棒的留言本的源码(二)】,下面是详细的分享!
挑战最棒的留言本的源码(二)
post.php文件<?php
require('config.php');
?>
<?php
$nikename=$arr_request['nikename'];
if(strlen($nikename)==0)
{
echo"<center>";
echo"<h2><fontcolor=red>错误信息!</font></h2>";
echo"对不起,<fontcolor=red>呢称</font>必须填写!!!请重填!<br>";
echo"<hr></hr>";
echo"免费留言本由<ahref=http://little.oso.com.cn>小熊</a>提供技术支持";
echo"</center>";
exit;
}
$date_now=date('Y/m/dH:i:s');
$ip_address=getenv("REMOTE_ADDR");
$messageold=$arr_request['message'];
//$pattern="/n/";
//$replacement="<br>";
$message=computer_message($messageold,$hang_zifu_number);
$subjectold=$arr_request['subject'];
if(strlen($subjectold)>$hang_zifu_number)
$subject=computer_message($subjectold,$hang_zifu_number);
else
$subject=$subjectold;
$str_sql="insertinto$table_name
(nikename,subject,date_created,ip_address,message,email_address,zhuye_address,oicq)
values
('$nikename',
'$subject',
'$date_now',
'$ip_address',
'$message',
'".$arr_request['email_address']."',
'".$arr_request['zhuye_address']."',
'".$arr_request['oicq']."'
)";
$result=mysql_db_query($db_name,$str_sql,$id_link);
if(!$result){
affy_error_exit('SQLInsertExecutionhasfailed.');
}
else
{
echo"<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">";
echo"<HTML><HEAD><TITLE>发表文章</TITLE>";
echo"<METAcontent="text/html;charset=gb2312"http-equiv=Content-Type>";
echo"<metaHTTP-EQUIV="REFRESH"CONTENT="2;URL=display.php">";
echo"</head><bodytopmargin="0"><br>";
echo"<ul>谢谢你发表留言,将自动显示留言内容";
echo"<br>";
echo"<ahref=http://www.chinaz.com/program/2008/0903/display.php>如果你的浏览器没有自动的返回到留言簿首页,?
请点这里返回.";
echo"</a></ul>";
exit;
}
?>
index.html文件
<html>
<center>
<title>谢谢你的留言!</title>
<h1><fontcolor=blue>我的留言本</font></h1>
<fontcolor=navy>首先感谢你的留言,你的每一句话我都会仔细阅读!!!</font>
<formaction="post.php"method="post">
<table>
<tr>
<td><fontcolor=teal>呢称:</font><fontcolor=red>(不能为空)</font></td><td>
<inputtype="text"name="nikename"value=""></td>
</tr>
<tr>
<td>OICQ号码:</td><td>
<inputtype="text"name="oicq"value=""></td>
</tr>
<tr>
<td>e-mail:</td><td>
<inputtype="text"name="email_address"value=""size="30"></td>
</tr>
<tr>
<td>个人主页:</td><td>
<inputtype="text"name="zhuye_address"value="http://"size="40"></td>
</tr>
<tr><td>
主题:</td><td>
<inputtype="text"name="subject"size="40"></td>
</tr>
<tr><td>
内容:</td><td></td>
</tr>
<tr><tdcolspan="2">
<textareaname="message"cols="60"rows="8"></textarea></td>
</tr>
<tr>
<td>
<inputtype="submit"value="完成留言">
</td>
<td>
<inputtype="reset"value="重新来过">
</td>
</tr>
</table>
</form>
<p>
<ahref=http://www.chinaz.com/program/2008/0903/display.php>查看留言</a>
<hr></hr>
免费留言本由<ahref="http://little.oso.com.cn">小熊</a>提供技术支持
</center>
</html>
display.inc文件!!!
<trbgcolor=>
<td>
<ahref=http://www.chinaz.com/program/2008/0903/mailto:<?phpecho$record->email_address?>>
<fontcolor="blue"size=4><strong><?phpecho$record->nikename?></strong></font>
</a>
</td>
<td><fontcolor="navy">留言时间:<?phpecho$record->date_created?></font></td>
<td>来自:
<?php
$ip_address=ip_question($record->ip_address);
echo$ip_address;
?>
</td>
</tr>
<trbgcolor=>
<thcolspan=3align=left>主题:<fontcolor=teal><?phpecho$record->subject?></font></th>
</tr>
<tr><thcolspan=3align=left><fontcolor="#416AAF">
<?phpecho$record->message?></font></th>
</tr>
<?php
if($record->huifu_biaozi)
{
?>
<tr><thcolspan=3align=left><fontcolor="red"><br><br>版主回复:</font><fontcolor="navy">
<?phpecho$record->huifu?></font></th>
</tr>
<?php
}
?>
<tr>
<thcolspan=3align=left><br>
<ahref=http://www.chinaz.com/program/2008/0903/mailto:<?phpecho$record->email_address?>>
<imgsrc=http://www.chinaz.com/program/2008/0903/image/mail.gif
alt="<?phpecho$record->nikename?>的e-mail地址是:<?phpecho$record->email_address?>"
border="0"width="15"length="15">邮件</a>
<ahref=http://www.chinaz.com/program/2008/0903/<?phpecho$record->zhuye_address?>><imgsrc=http://www.chinaz.com/program/2008/0903/image/home.gif
alt="<?phpecho$record->nikename?>的主页地址是:<?phpecho$record->zhuye_address?>"
border="0"
width="14"length="14">主页</a>
<imgsrc=http://www.chinaz.com/program/2008/0903/image/oicq.gifborder="0"alt="<?phpecho$record->nikename?>的OICQ是:
<?phpecho$record->oicq?>"
width="14"length="14">OICQ</a>
<ahref=http://www.chinaz.com/program/2008/0903/action.php?action=delete&key_liuyan=<?phpecho$record->key_liuyan?>><imgsrc=http://www.chinaz.com/program/2008/0903/image/del.gifborder="0"width="12"length="12"alt="只有版主才有删除的权限哦!">删除</a>
<ahref=http://www.chinaz.com/program/2008/0903/action.php?action=huifu&key_liuyan=<?phpecho$record->key_liuyan?>><imgsrc=http://www.chinaz.com/program/2008/0903/image/replay.gifborder="0"width="14"length="14"alt="不好意思,现在暂时只有版主才能回复">回复</a>
</th></tr>
<tr>
<tdcolspan="3"><hrSIZE="1"></td>
</tr>
以上所分享的是关于挑战最棒的留言本的源码(二),下面是编辑为你推荐的有价值的用户互动:
相关问题:求 asp+txt 留言本代码(最好完整版)有源码的大侠...
答:手里刚好有一个ASP+txt的留言本,很简单的,它采用记事本来记录留言内容,并将留言内容显示在网页上。当然你也可以自己... >>详细
相关问题:求高手知道PHP留言板的留言回复功能编写,最好能讲...
答:首先数据库表设置三个字段 1.自增 Id 2.留言内容 content 3.回复 reply 添加留言内容时会自动产生一个独有的Id号 回复时... >>详细
相关问题:求 html中的留言本的源代码
答:这是我最近做的一个留言板,里面加入了JavaScript脚本,不知道算不算超出你要求。完成了一些验证码生成和验证的操作。如果不合适,你修改修改,还不行就问我。 Untitled Document function sryzm(){ document.getElementById("yzhengma").value ... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
