<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% call aspsql() '调用sitefunction.asp页中的函数来检查SQL语句 dim rsnotebook,maxlength,view,mailyes,yzm dim sql_post,sql_data,server_v1,server_v2,qq,title set rsnotebook=conn.execute("select * from notebook_setup") '执行查询语句,并把记录集数据放在变量中 maxlength=clng(rsnotebook("maxlength")) '留言中能够填写的最大字符数 转为长整 view=cstr(rsnotebook("view")) '留言是否要经过审核 1通过审核 0未通过 mailyes=clng(rsnotebook("mailyes")) '留言是是否要填写emai 1不必填写 0必须填写 randomize '起动随机数运算引擎 yzm=int(8999*rnd()+1000) '获的随机数 '************************************************************************************************************* %> <% '******************************************************提交数据******************************************************** dim name,qqtitle,content,face,pic,ip,online,a,b,c,d if request("send")="ok" then '利用隐藏域提交代码 call site_check_path() email=Trim(Request.Form("email")) '获取Email值 if mailyes=0 then '如果notebook_setup表中的mailyes字段设置为0,检查Email合法性 if Instr(email,".")<=0 or Instr(email,"@")<=0 or len(email)<10 or len(email)>100 then response.Write "" response.end end if end if '取出数据 name=Trim(Request.Form("name")) '姓名 email=Trim(Request.Form("email")) '电子邮箱 urle=Trim(Request.Form("url")) '主页 qq=Trim(Request.Form("qq")) 'QQ号 title=Trim(Request.Form("title")) '留言主题 content=Trim(Request.Form("content")) '留言内容 face=Trim(Request.Form("face")) '表情 pic=Trim(Request.Form("pic")) '头像 ip=request.ServerVariables("REMOTE_ADDR") 'IP地址 online=view '是否经过审核 conn.execute("insert into notebook(name,email,url,qq,title,content,face,pic,ip,online) values('"&name&"','"&email&"','"&urle&"','"&qq&"','"&title&"','"&content&"','"&face&"','"&pic&"','"&ip&"','"&online&"')") '数据提交成功,回到留言主页。如果notebook_setup表中的view字段设置为0,留言需要审核。 response.Write "" response.End end if '******************************************************提交数据******************************************************** %> <% call showVM() %> <%'**************************************************校验表单****************************************************%>
首页 > 网站留言  
您的姓名:
您的邮箱:
您的网站:
腾讯QQ:
主题:

内容:
(<%=maxlength%>字以内)

验证
<% '验证码的运算 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 "
" %>