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

📄 book_write.asp

📁 网上购物系统 asp+sql server 2005
💻 ASP
字号:
<!--#include file="include/dbopenbd.asp"-->
<%

set rs=conn.execute("select * from s_setup")
maxlength=clng(rs("maxlength"))
view=cstr(rs("view"))
mailyes=clng(rs("mailyes"))
randomize
yzm=int(8999*rnd()+1000)
%>
<SCRIPT language=javascript>
<!--
function left_menu(meval)
{
  var left_n=eval(meval);
  if (left_n.style.display=="none")
  { eval(meval+".style.display='';"); }
  else
  { eval(meval+".style.display='none';"); }
}
-->
</SCRIPT>
<script language="JavaScript">
function checkform(){
<%
response.write "if (document.book.yzm.value.length==0){"
%>
		alert("出错了,您没有填写验证码。");
		document.book.yzm.focus();
		return false;
	}
<%
response.write "if (document.book.yzm.value!="&yzm&"){"
%>
		alert("出错了,您填写的验证码不正确。");
		document.book.yzm.focus();
		return false;
	}
	if (document.book.UserName.value.length==0){
		alert("出错了,您没有填写用户名。");
		document.book.UserName.focus();
		return false;
	}
	if (document.book.UserName.value.length<2||document.book.UserName.value.length>16){
		alert("出错了,您填写的用户名不符合要求。");
		document.book.UserName.focus();
		return false;
	}
	if (document.book.Comments.value.length==0){
		alert("出错了,您没有填写留言内容。");
		document.book.Comments.focus();
		return false;
	}
<%
response.write "if (document.book.Comments.value.length>"&maxlength&"){"
%>
		alert("出错了,您的留言太长了。");
		document.book.Comments.focus();
		return false;
	}
	return true;
}	
</script>

<%
if request("send")="ok" then

	username=aspsql(request.form("username"))
	usermail=aspsql(request.form("usermail"))

	if usermail<>"" then		'如果邮箱不为空,检查邮箱是否合法
		if Instr(usermail,".")<=0 or Instr(usermail,"@")<=0 or len(usermail)<10 or len(usermail)>100 then
			mGoBack "出错了,您输入的电子邮件地址格式不正确,请检查后重新输入"
		end if
	end if

	set rs=Server.CreateObject("ADODB.RecordSet")
	sql="select * from s_book where online='1' order by Postdate desc"
	rs.open sql,conn,1,3
			rs.Addnew
			rs("username")=aspsql(Request("username"))
			rs("comments")=aspsql(Request("comments"))
			rs("usermail")=aspsql(Request("usermail"))
			rs("face")=aspsql(Request("face"))
			rs("pic")=aspsql(Request("pic"))
			rs("url")=aspsql(Request("url"))
			rs("qq")=aspsql(Request("qq"))
			rs("online")=view
			rs("IP")=Request.serverVariables("REMOTE_ADDR")
			rs.Update
		rs.close
		set rs=nothing
	response.write "<script language='javascript'>"
	if view="0" then
		response.write "alert('留言提交成功,留言须经管理员审核才能发布。');"
	else
		response.write "alert('留言提交成功,单击“确定”返回留言列表!');"
	end if
	response.write "location.href='book.asp';"	
	response.write "</script>"
	response.end

end if
%>

<HTML><HEAD>
<TITLE>网站留言-<%=sitename%>-<%=siteurl%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitedescription%>">
<meta name="keywords" content="<%=sitekeywords%>">
<link rel="stylesheet" href="include/css.css" type="text/css">

</HEAD>
<body>

<center>
<!--#include file="a_top.asp"-->
<table width="760" border=0 cellspacing=0 cellpadding=0 align=center bgcolor="#FFFFFF"  class="grayline">

<td  height=30>&nbsp;目前位置:<a href=main.asp>首页</a> > 在线留言 </td></tr>
<tr><td width="98%" align="center" height="1" background="images/small/bgline.gif"></td></tr>
<tr><td align=center height=80>
<a href=book_write.asp><img border=0 src=images/small/write.gif title="我要写留言"></a> &nbsp;&nbsp;&nbsp;&nbsp;  <a href=book.asp><img border=0 src=images/small/read.gif title="我要看留言"></a>
</td></tr>

<tr><td>

<form method="post" name="book" action="book_write.asp" onsubmit="return checkform();">

<table cellSpacing="1" borderColorDark="#ffffff" cellPadding="4" width="680" align="center" bgColor="#000000" borderColorLight="#000000" border="0">
  <tr bgColor="#ebebeb">
    <td width="20%" align=right>留言验证码:</td>
    <td>
	<input  maxlength=4 size=6 name="yzm" style="BORDER-RIGHT: darkgray 1px solid; BORDER-TOP: darkgray 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: darkgray 1px solid; COLOR: #666666; BORDER-BOTTOM: darkgray 1px solid; FONT-FAMILY: verdana ; overflow:auto;">
<%
a=int(yzm/1000)
b=int((yzm-a*1000)/100)
c=int((yzm-a*1000-b*100)/10)
d=int(yzm-a*1000-b*100-c*10)
response.write "<img align=top height=15 border=0 src=images/yzm/"&a&".gif><img align=top height=15 border=0 src=images/yzm/"&b&".gif><img  align=top height=15 border=0 src=images/yzm/"&c&".gif><img align=top height=15 border=0 src=images/yzm/"&d&".gif>"
%></td>
 </tr>
  <tr bgColor="#ebebeb">
    <td   width="20%" align=right>您的姓名:</td>
    <td ><input type=text name="UserName" size="30" maxlength=16  style="BORDER: darkgray 1px solid; FONT-SIZE: 8pt; COLOR: #666666; FONT-FAMILY: verdana ; overflow:auto; height=22;" value="<%=request.cookies("buyok")("userid")%>">
      <font color="#FF0000">*</font></td>   
  </tr>
  <tr bgColor="#ebebeb">
    <td   width="20%" align=right>您的邮箱:</td>
    <td ><input type=text name="UserMail" size="30"  maxlength=100  style="BORDER: darkgray 1px solid; FONT-SIZE: 8pt; COLOR: #666666; FONT-FAMILY: verdana ; overflow:auto; height=22;"></td>   
  </tr>
  <tr bgColor="#ebebeb">
    <td   width="20%" align=right>您的网站:</td>
    <td><input type=text value="http://" name="url" size="30"  maxlength=100  style="BORDER: darkgray 1px solid; FONT-SIZE: 8pt; COLOR: #666666; FONT-FAMILY: verdana ; overflow:auto; height=22;"></td>
  </tr>
  <tr bgColor="#ebebeb">
    <td   width="20%" align=right>腾讯QQ:</td>
    <td><input type=text value="" name="QQ" size="30"  maxlength=11  style="BORDER: darkgray 1px solid; FONT-SIZE: 8pt; COLOR: #666666; FONT-FAMILY: verdana ; overflow:auto; height=22;"></td>
  </tr>
  <tr bgColor="#ebebeb">
    <td   width="20%" align=right>留言内容:<br><font color=red>(<%=maxlength%>字以内)</font></td>
    <td><textarea name="Comments" rows="7" cols="66"  style="BORDER: darkgray 1px solid; FONT-SIZE: 8pt; COLOR: #666666; FONT-FAMILY: verdana ; overflow:auto;"></textarea></td>
  </tr>
  <tr bgColor="#ebebeb">
    <td width="20%" align=right>表情:</td><td>
	<input type="radio" value="1" name="face" checked><img border=0 src="images/face/face1.gif"> 
	<input type="radio" value="2" name="face"><img border=0 src="images/face/face2.gif">
	<input type="radio" value="3" name="face"><img border=0 src="images/face/face3.gif">
	<input type="radio" value="4" name="face"><img border=0 src="images/face/face4.gif">
	<input type="radio" value="5" name="face"><img border=0 src="images/face/face5.gif">
	<input type="radio" value="6" name="face"><img border=0 src="images/face/face6.gif"> 
	<input type="radio" value="7" name="face"><img border=0 src="images/face/face7.gif">
	<input type="radio" value="8" name="face"><img border=0 src="images/face/face8.gif">
	<input type="radio" value="9" name="face"><img border=0 src="images/face/face9.gif">
	<input type="radio" value="10" name="face"><img border=0 src="images/face/face10.gif">
	<br>
	<input type="radio" value="11" name="face"><img border=0 src="images/face/face11.gif"> 
	<input type="radio" value="12" name="face"><img border=0 src="images/face/face12.gif">
	<input type="radio" value="13" name="face"><img border=0 src="images/face/face13.gif">
	<input type="radio" value="14" name="face"><img border=0 src="images/face/face14.gif">
	<input type="radio" value="15" name="face"><img border=0 src="images/face/face15.gif">
	<input type="radio" value="16" name="face"><img border=0 src="images/face/face16.gif"> 
	<input type="radio" value="17" name="face"><img border=0 src="images/face/face17.gif">
	<input type="radio" value="18" name="face"><img border=0 src="images/face/face18.gif">
	<input type="radio" value="19" name="face"><img border=0 src="images/face/face19.gif">
	<input type="radio" value="20" name="face"><img border=0 src="images/face/face20.gif">

    </td>
  </tr>
  <tr bgColor="#ebebeb">
    <td width="20%" align=right>头像:</td>
    <td><input type="radio" value="1" name="pic" checked><img border=0 src="images/face/pic1.gif" width=60>
	<input type="radio" value="2" name="pic"><img border=0 src="images/face/pic2.gif" width=60>
	<input type="radio" value="3" name="pic"><img border=0 src="images/face/pic3.gif" width=60>
	<input type="radio" value="4" name="pic"><img border=0 src="images/face/pic4.gif" width=60>
	<input type="radio" value="5" name="pic"><img border=0 src="images/face/pic5.gif" width=60>
	<br>
	<input type="radio" value="6" name="pic"><img border=0 src="images/face/pic6.gif" width=60>
	<input type="radio" value="7" name="pic"><img border=0 src="images/face/pic7.gif" width=60>
	<input type="radio" value="8" name="pic"><img border=0 src="images/face/pic8.gif" width=60>
	<input type="radio" value="9" name="pic"><img border=0 src="images/face/pic9.gif" width=60>
	<input type="radio" value="10" name="pic"><img border=0 src="images/face/pic10.gif" width=60>
	</td>
      
  </tr>
  <tr bgColor="#ebebeb">
    <td colSpan="2" height=50 align=center><input type="submit" value="提交留言" name="Submit1"> &nbsp;&nbsp;&nbsp;
      <input type="reset" value="重新填写" name="Submit2"><input type=hidden name=send value=ok></td>
  </tr>
  <TR><TD bgcolor=#FFFFFF colspan=2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  * 请各位网友遵纪守法并注意语言文明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  *<A href=guiding1.asp target=_blank><u>《互联网电子公告服务管理规定》</u></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  *<a href=guiding2.asp target=_blank><u>《全国人大常委会关于维护互联网安全的规定》</u></a>
</TD></TR>

</table>
</form>



<tr><td><br><br><br><br></td></tr>
<tr><td width="98%" align="center" height="1" background="images/small/bgline.gif"></td></tr>
<tr><td><br></td></tr>
</table>


<!--#include file="a_bottom.asp"-->
</center>
</body>
</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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