www.gusucode.com > 黑鹰友情链接交换系统美化版 1.2 黑码程序 > save.asp
<%@ Language=VBScript %> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--#INCLUDE FILE="conn.asp" --> <% '----------------读取数据------------------- txtname=left(request("txtname"),12) txtemail=left(request("txtemail"),30) txthomepage=left(request("txthomepage"),30) txtlogo=left(request("txtlogo"),50) txtsite=left(request("txtsite"),20) txtjj=left(request("txtjj"),50) if hits="" then hits="0" '--------------判断名字 if trim(txtsite)="" then response.write "<script language='javascript'>" & VbCRlf response.write "alert('请填写您的网站名称!');" & VbCrlf response.write "history.go(-1);" & vbCrlf response.write "</script>" & VbCRLF response.end end if '-------------------网址判断-------------- if trim(txthomepage)="http://" or trim(txthomepage)="" then response.write "<script language='javascript'>" & VbCRlf response.write "alert('请填写您的网址!');" & VbCrlf response.write "history.go(-1);" & vbCrlf response.write "</script>" & VbCRLF response.end end if '-------------------内容判断-------------- if trim(txtjj)="" then response.write "<script language='javascript'>" & VbCRlf response.write "alert('请填写网站简介!');" & VbCrlf response.write "history.go(-1);" & vbCrlf response.write "</script>" & VbCRLF response.end 'else 'response.write txtjj 'response.end end If '--------------判断验证码 If Trim(Request.Form("codestr"))=Empty Or Trim(Session("rc0576.com_codestr"))<>Trim(Request.Form("codestr")) Then response.write "<script language=JavaScript>" & chr(13) & "alert('请输入正确的验证码');" & "history.back()" & "</script>" response.end end If '------------数据编码--------------- txthomepage=server.htmlencode(txthomepage) txtsite=server.htmlencode(txtsite) txtjj=server.htmlencode(txtjj) txtlogo=server.htmlencode(txtlogo) '------把信息写进数据库------------- Set rs= Server.CreateObject("ADODB.Recordset") sql="select * from link" rs.open sql,conn,3,2 rs.addnew rs("logo")=txtlogo rs("hits")=hits rs("homepage")=txthomepage rs ("site")=txtsite rs("jj")=txtjj rs("linktime")=date() rs.update rs.close response.redirect "index.asp" %>