<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% Response.Buffer = True Dim Country, Province, City Dim ShowCountry, ShowProvince, ShowCity Dim TempConn, TempRs Country = ReplaceBadChar(Trim(Request("Country"))) Province = ReplaceBadChar(Trim(Request("Province"))) City = ReplaceBadChar(Trim(Request("City"))) If Country = "" Then Country = "中华人民共和国" If Province = "" Then Province = "北京市" If City = "" Then City = "海淀区" 'On Error Resume Next Call OpenConn Set TempRs = Conn.Execute("SELECT Country FROM PE_Country ORDER BY Country") If Err Or TempRs.EOF Then FoundErr = True Else ShowCountry = TempRs.GetRows(-1) End If Set TempRs = Conn.Execute("SELECT Province FROM PE_Province WHERE Country='" & Country & "' ORDER BY ProvinceID") If Err Or TempRs.EOF Then ReDim ShowProvince(0, 0) Else ShowProvince = TempRs.GetRows(-1) End If Set TempRs = Conn.Execute("SELECT DISTINCT City FROM PE_City WHERE Province='" & Province & "'") If Err Or TempRs.EOF Then ReDim ShowCity(0, 0) Else ShowCity = TempRs.GetRows(-1) End If Set TempRs = Nothing Call CloseConn If FoundErr = True Then Response.Write "Conn连接错误,请检查Conn连接!" & vbCrLf End If %>
国家/地区:
省/市/自治区:
市/县/区/旗:
<% Function ReplaceBadChar(strChar) If strChar = "" Or IsNull(strChar) Then ReplaceBadChar = "" Exit Function End If Dim strBadChar, arrBadChar, tempChar, i strBadChar = "+,',--,%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & "" arrBadChar = Split(strBadChar, ",") tempChar = strChar For i = 0 To UBound(arrBadChar) tempChar = Replace(tempChar, arrBadChar(i), "") Next tempChar = Replace(tempChar, "@@", "@") ReplaceBadChar = tempChar End Function %>