⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="../inc/conn.asp"-->
<%
username=request("username")
set rsuser=conn.execute("select * from [gbuser] where username='"&username&"' and state=1")
	if rsuser.bof then
		response.write "<script language=javascript>alert( ""没有这个用户,或者此用户留言本已经关闭!"");</script>"
		response.end
end if
if request("action")="post" then
Call add()
end if
%>
<HTML><HEAD><TITLE>给<%=username%>留言</TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312">
<LINK href="images/style.css" type=text/css rel=stylesheet>
<script>function showimage(){document.images.tus.src="images/"+document.form.sex.options[document.form.sex.selectedIndex].value+"/"+document.form.head.options[document.form.head.selectedIndex].value+".gif";}</script>
<script language="javascript">
function check_input()  
{  
	if (form.name.value=="")
	{   alert("请输入您的姓名!");
		form.name.focus();
		return false;
	}
	if (form.title.value=="")
	{   alert("请输入留言标题!");
		form.title.focus();
		return false;
	}
	if (form.content.value=="")
	{   alert("请填写留言内容!");
		form.content.focus();
		return false;
	}
    return true;
}
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD width=54><IMG src="images/topleft.gif"></A></TD>
    <TD width=296><A href="http://www.nease.net/"><IMG 
      src="images/logo.gif" border=0></A></TD>
    <TD background=images/topright.gif>&nbsp;<%=rsuser("uphtml")%></TD>
  </TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=6 width="99%" align=center bgColor=#ffffff 
border=0>
  <TBODY>
    <TR>
      <TD><A href="index.asp?username=<%=rsuser("username")%>"><%=rsuser("username")%>的留言本</A> -&gt; 发表留言 </TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="70%" border=0 align=center cellPadding=10 cellSpacing=1 bgcolor="#41b1e3">
<form name="form" action="?action=post" method="post" onSubmit="return check_input();">
    <TD>
    <TR bgColor=#ddf3fe><TD colSpan=2><B>给<%=username%>留言</B></TD></TR>
        <TR bgColor=#ffffff>
          <TD>您的姓名</TD>
          <TD><INPUT name=name id="name" size=20 maxlength="5"> </TD></TR>
        <TR bgColor=#ffffff>
          <TD>留言标题</TD>
          <TD><INPUT name=title id="title" size=60> 
          最多30汉字 </TD></TR>
        <TR bgColor=#ffffff>
          <TD>性别</TD>
          <TD>男
            <input name="sex" type="radio" value="1" checked> 
            <input type="radio" name="sex" value="0"> </TD>
        </TR>
        <TR bgColor=#ffffff>
          <TD bgColor=#ffffff>留言表情:</TD>
          <TD><INPUT name=face type=radio value=1 checked> 
          <IMG height=19 
            src="images/icon1.gif" width=19> <INPUT type=radio value=2 
            name=face> <IMG height=19 src="images/icon2.gif" width=19> 
            <INPUT type=radio value=3 name=face> <IMG height=19 
            src="images/icon3.gif" width=19> <INPUT type=radio value=4 
            name=face> <IMG height=19 src="images/icon4.gif" width=19> 
            <INPUT type=radio value=5 name=face> <IMG height=19 
            src="images/icon5.gif" width=19> <INPUT type=radio value=6 
            name=face> <IMG height=19 src="images/icon6.gif" width=19> 
            <INPUT type=radio value=7 name=face> <IMG height=19 
            src="images/icon7.gif" width=19> <INPUT type=radio value=8 
            name=face> <IMG height=19 src="images/icon8.gif" width=19> 
            <INPUT type=radio value=9 name=face> <IMG height=19 
            src="images/icon9.gif" width=19><BR><INPUT type=radio value=10 
            name=face> <IMG height=19 src="images/icon10.gif" width=19> 
            <INPUT type=radio value=11 name=face> <IMG height=19 
            src="images/icon11.gif" width=19> <INPUT type=radio value=12 
            name=face> <IMG height=19 src="images/icon12.gif" width=19> 
            <INPUT type=radio value=13 name=face> <IMG height=19 
            src="images/icon13.gif" width=19> <INPUT type=radio value=14 
            name=face> <IMG height=19 src="images/icon14.gif" width=19> 
            <INPUT type=radio value=15 name=face> <IMG height=19 
            src="images/icon15.gif" width=19> <INPUT type=radio value=16 
            name=face> <IMG height=19 src="images/icon16.gif" width=19> 
            <INPUT type=radio value=17 name=face> <IMG height=19 
            src="images/icon17.gif" width=19> <INPUT type=radio value=18 
            name=face> <IMG height=19 src="images/icon18.gif" width=19> 
        </TD></TR>
        <TR bgColor=#ffffff>
          <TD noWrap bgColor=#ffffff>留言内容:</TD>
          <TD><TEXTAREA name=content rows=10 cols=80></TEXTAREA> </TD></TR>
        <TR bgColor=#ffffff>
          <TD align=middle colSpan=2 height=30><INPUT type=hidden 
            value=<%=username%> name=username> <INPUT type=image 
            src="images/posting.gif" name=submit>&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:history.back()"><IMG 
            src="images/return.gif" border=0></a> 
</TD>
        </TR></form></TABLE>
      <TABLE cellSpacing=1 cellPadding=10 width="70%" align=center border=0>
        <TBODY>
        <TR>
          <TD><BR><FONT class=f14 
            color=#df0024>注意事项</FONT><BR><BR>禁止发表下列信息,一切发表,仅代表作者本人立场. 
            <BR>(一)反对宪法所确定的基本原则的; <BR>(二)危害国家安全,泄露国家秘密,破坏国家统一的; 
            <BR>(三)损害国家荣誉和利益的; <BR>(四)煽动民族仇恨、民族歧视,破坏民族团结的; 
            <BR>(五)破坏国家宗教政策,宣扬邪教和封建迷信的; <BR>(六)散布谣言,扰乱社会秩序,破坏社会稳定的; 
            <BR>(七)散布淫秽、色情、赌博、暴力、犯罪的; 
        <BR>(八)侮辱或者诽谤他人,侵害他人合法权益的;<BR><BR></TD></TR></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=1 cellPadding=4 width="99%" align=center border=0>
        <TBODY>
        <TR>
          <TD align=center><%=rsuser("downhtml")%> </TD>
        </TR></TBODY></TABLE>
</BODY></HTML>
  <%
rsuser.close
set rsuser=nothing
Sub add()
rs.Open "select * from gbook",conn,1,3
rs.addnew
rs("username")=Trim(Request.Form("username"))
rs("name")=Trim(Request.Form("name"))
rs("title")=Trim(Request.Form("title"))
rs("sex")=Trim(Request.Form("sex"))
rs("face")=Trim(Request.Form("face"))
rs("content")=Trim(Request.Form("content"))
rs("postip")=Request.servervariables("REMOTE_ADDR")
rs("hits")=0
rs("posttime")=Now()
rs.update
rs.close
response.write "<script language=javascript>alert('恭喜 !留言成功 ');location.href='index.asp?username="&username&"';</script>"
End sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -