就这一页。是一个信息提交页
<!--#include file="Conn.asp"-->
<!--#include file="setup.asp"-->
<!--#include file="inc/function.asp"-->
<%if Request.Cookies("username")="" Then
Response.Write"<script>alert(""请选登陆"");location.href=""User.asp"";</script>"
Response.End
End if
Dim proof,GetCode
proof=Strint(Request("proof"))
GetCode=Strint(Session("GetCode"))
Session("GetCode")=""
If proof<>GetCode Or GetCode=0 Then
Response.Write"<script>alert('验证码错误,请刷新后重填!');history.go(-1)</script>"
Response.End()
End If
Dim dtitle,dcolor,dbgcolor1,dcu,dlei,dispic,dpic,dtext,dstop,dtop,dmoney,sql,Rs
dtitle=HtmlEncode(Request.Form("dtitle"))
dcolor=HtmlEncode(Request.Form("dcolor"))
dcu=HtmlEncode(Request.Form("dcu"))
city_oneid=strint(Request.Form("city_one"))
city_twoid=strint(Request.Form("city_two"))
city_threeid=strint(Request.Form("city_three"))
type_oneid=strint(Request.Form("type_one"))
type_twoid=strint(Request.Form("type_two"))
type_threeid=strint(Request.Form("type_three"))
dispic=HtmlEncode(Request.Form("dispic"))
dpic=HtmlEncode(Request.Form("dpic"))
IF dpic<>"" Then
IF lcase(left(dpic,7))="http://" Or lcase(right(dpic,3))="asp" Or lcase(right(dpic,3))="htm" Then dpic=""
End IF
dtext=HtmlEncode2(Request.Form("dtext"))
dusername=HtmlEncode(Request.Form("dusername1"))
dtel=HtmlEncode(Request.Form("dtel1"))
dcardid=HtmlEncode(Request.Form("dcardid1"))
dstop=dateadd("d",Request.Form("dstop"),date())
dblink
city_one=Conn.Execute("select city from china_city where twoid=0 and id="&city_oneid)(0)
If city_twoid>0 Then city_two=Conn.Execute("select city from china_city where id="&city_oneid&" and threeid=0 and twoid="&city_twoid)(0)
If city_threeid<>0 Then city_three=Conn.Execute("select city from china_city where id="&city_oneid&" and twoid="&city_twoid&" and threeid="&city_threeid)(0)
type_one=Conn.Execute("select name from china_type where twoid=0 and id="&type_oneid)(0)
If type_twoid<>0 Then type_two=Conn.Execute("select name from china_type where id="&type_oneid&" and threeid=0 and twoid="&type_twoid)(0)
If type_threeid<>0 Then type_three=Conn.Execute("select name from china_type where id="&type_oneid&" and twoid="&type_twoid&" and threeid="&type_threeid)(0)
If dtitle="" Or city_oneid="" Or type_oneid="" Or dtext="" Then
Conn.close:Set Conn=Nothing
Response.Write"<script>alert('请认真填写!');history.go(-1)</script>"
Response.End
End If
'使用数组 返回值数组 = Split("字符串","分割符")<br />
'IsArray()判断是否数组的函数,LBound()取数组的下标,UBound()取数组的上标。
unhtmlgl=split(webguolv,"|")
If IsArray(unhtmlgl) Then
for i=0 to UBound(unhtmlgl)
dtitle=replace(dtitle,unhtmlgl(i),"***")
next
End If
unhtmlgl=split(webguolv,"|")
If IsArray(unhtmlgl) Then
for i=0 to UBound(unhtmlgl)
dtext=replace(dtext,unhtmlgl(i),"***")
next
End If
sql="select * from china_data"
Set Rs=Server.createobject("adodb.recordset")
Rs.open sql,Conn,1,3
Rs.addnew
Rs("uid")=Request.Cookies("username")
Rs("title")=dtitle:
Rs("color")=dcolor:
Rs("cu")=dcu
Rs("city_oneid")=city_oneid:Rs("city_one")=city_one:Rs("city_two")=city_two:Rs("city_twoid")=city_twoid:Rs("city_three")=city_three:Rs("city_threeid")=city_threeid
Rs("type_oneid")=type_oneid:Rs("type_one")=type_one:Rs("type_twoid")=type_twoid:Rs("type_two")=type_two:Rs("type_threeid")=type_threeid:Rs("type_three")=type_three
Rs("ispic")=dispic
If lcase(left(dpic,7))="http://" Then dpic=""
Rs("pic")=dpic:Rs("text")=dtext:Rs("username")=dusername:Rs("tel")=dtel:Rs("cardid")=dcardid:Rs("stop")=dstop:Rs("money")=0
If webinfo="1" Then
Rs("mark")="no" '审核后通过
Else
Rs("mark")="yes" '直接通过
End If
Rs("ip")=getIP
Rs.update
id=Rs("adid")
Rs.close:Set Rs=Nothing
Conn.close:Set Conn=Nothing
If webinfo="1" Then
Response.Write"<script>alert('您的信息已经提交成功,请等待管理员的审核。请牢记本条信息的ID号:"&id&" 以便电话查询和修改信息');location='user.asp'</script>"
Else
''''''''''''''''''生成html开始''''''''''''''''''''''''''
ServerURL=CStr(Request.ServerVariables("SCRIPT_NAME"))
n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
ServerURL=left(ServerURL, n)'显示从左边数第"n"个字符前面的字符,
ServerURL="http://"&Request.ServerVariables("SERVER_NAME")&""&ServerURL&"show.asp?id="&id&""
Set http=Server.createobject("Ms" & "xml" & "2.XM" & "LHTTP")
Http.open "get",ServerURL,false
Http.send()
Dim Temp,TempPath
If Http.readystate=4 Then
TempPath=Server.mappath("html/"&id&".htm")
AA=Http.responseText
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
Set htmout = objfso.CreateTextFile(TempPath)
htmout.Write rep1(AA)
htmout.close:Set htmout=Nothing
IF objfso.FileExists(TempPath) Then
IF objfso.Getfile(TempPath).Size>100 Then
Temp="html/"&id&".htm"
End IF
End IF
Set objfso=Nothing
End IF
Set http=Nothing
IF Temp="" Then Temp="show.asp?id="&id
''''''''''''''''''生成html结束''''''''''''''''''''''''''
Response.Write"<script>alert('恭喜您的信息已经发布成功!现在跳转到您发布的信息页面!');location='"&Temp&"'</script>"
End If %>