<%function SaveSqlLog(dlxf_Log_type)
'dlxf_type  日志属性   0为前台,1为后台,2为个人后台,3为企业后台
If Request.Form<>"" or Request.QueryString<>"" Then
select case dlxf_Log_type
  case 0
    if session("useradmin")<>"" then dlxf_Log_user=session("useradmin") else dlxf_Log_user="客人"
  case 1
    if session("admin")<>"" then dlxf_Log_user=session("admin") else dlxf_Log_user="客人"
  case 2
    if session("individualuser")<>"" then dlxf_Log_user=session("individualuser") else dlxf_Log_user="客人"
  case 3
    if session("useradmin")<>"" then dlxf_Log_user=session("useradmin") else dlxf_Log_user="客人"
end select

err.clear
If IsObject(LogConn) = false Then
set LogConn = Server.CreateObject("ADODB.Connection")
LogConn.Open SqlLogdata
If Err.Number <> 0 Then
  Response.write "系统日常维护中!"
  'response.Write(sqllogdata)
   'response.Write(err.description)
   Response.End()
end if
end if

dlxf_Log_type=int(dlxf_Log_type)
dlxf_Log_ScriptName=Request.ServerVariables("url")
if Request.Form <>"" then dlxf_Log_Info=Request.Form else dlxf_Log_Info=Request.QueryString
dlxf_Log_IP=Request.ServerVariables("Remote_Addr")

set LogRs=Server.CreateObject("Adodb.Recordset")
LogSql="select * from dlxf_log"
LogRs.open LogSql,LogConn,1,3
LogRs.addnew
LogRs("dlxf_ScriptName")=dlxf_Log_ScriptName
LogRs("dlxf_Info")=dlxf_Log_Info
LogRs("dlxf_IP")=dlxf_Log_IP
LogRs("dlxf_Time")=now()
LogRs("dlxf_type")=dlxf_Log_type
LogRs("dlxf_user")=dlxf_Log_user
LogRs.update
LogRs.close
set LogRs=nothing
LogConn=close
set LogConn=nothing

end if
end function
'=======================================================防SQL注入
function SF_Sql
Fy_In = application("citysql")
'----------------------------------
Fy_Inf = split(Fy_In,"|")
'--------POST部份------------------
If Request.Form<>"" Then
For Each Fy_Post In Request.Form
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.Form(Fy_Post)),Fy_Inf(Fy_Xh))<>0 Then
response.write"<script>alert('操作错误，下面是产生错误的可能原因：\n\n·在您提交的资料中含有敏感字符');history.go(-1);</script>"
response.end
End If
Next
Next
End If
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each Fy_Get In Request.QueryString
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))<>0 Then
response.write"<script>alert('操作错误，下面是产生错误的可能原因：\n\n·在您提交的资料中含有敏感字符');history.go(-1);</script>"
response.end
End If
Next
Next
End If
end function
'=======================================================防SQL注入
function SF_PingSql
Fy_In = application("cityping")
'----------------------------------
Fy_Inf = split(Fy_In,"|")
'--------POST部份------------------
If Request.Form<>"" Then
For Each Fy_Post In Request.Form
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.Form(Fy_Post)),Fy_Inf(Fy_Xh))<>0 Then
response.write"<script>alert('操作错误，下面是产生错误的可能原因：\n\n·在您提交的资料中含有敏感字符');history.go(-1);</script>"
response.end
End If
Next
Next
End If
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each Fy_Get In Request.QueryString
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))<>0 Then
response.write"<script>alert('操作错误，下面是产生错误的可能原因：\n\n·在您提交的资料中含有敏感字符');history.go(-1);</script>"
response.end
End If
Next
Next
End If
end function

Function cpimages(countent) '提取数据中第一幅图片的路径
beginstr=instr(countent,"src=")
if beginstr=0 then exit function
heodinstr=instr(beginstr,countent," ")
countent=mid(countent,beginstr+4,heodinstr-beginstr-4)
cpimages=countent
end function
%>