
")
fString = Replace(fString, CHR(10), "
")
HTMLEncode = fString
end if
end function
'=================================
'函数名:nohtml(str)
'参数:str(字串)
'功能:去除HTML标记,返回文本字串
'=================================
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
nohtml=str
set re=nothing
end function
'===============================
'函数名:HTMLcode(Content)
'参数:字符串
'功能:返回HTML代码
'===============================
function HTMLcode(Content)
if not isnull(Content) then
Content = Replace(Content, " "," ")
Content = Replace(Content, ">", ">")
Content = Replace(Content, "<", "<")
Content = Replace(Content, "\", "\\")
Content = Replace(Content, vbCrLf, "
")
Content = Replace(Content, CHR(10), "
")
Content = Replace(Content, CHR(34), """)
Content = Replace(Content, CHR(39), "'")
HTMLcode = Content
end if
end function
'==============================
'过程名:ShowMsg(Msg,URL)
'参数:字串,要输出的参数;地址,如果为"BACK"则返回上一页
'功能:在客户端输出警告消息,跳转至URL
'==============================
Sub ShowMsg(Msg,URL)
response.write "" & VbCRLF
End Sub
'===========================
'函数名:checkpost()
'参数:无
'功能:判断是否为本站提交的url
'返回值:如果为本站的返回为Ture,否则为Flase
'============================
function checkpost()
dim server_str1,server_str2
checkpost=false
server_str1=cstr(request.servervariables("http_referer"))
server_str2=cstr(request.servervariables("server_name"))
if mid(server_str1,8,len(server_str2))=server_str2 then
checkpost=True
end if
end function
'===========================
'函数名:safestr(str)
'参数:字符串
'功能:对STR进行过滤,去掉一些特殊符号,防止sql注射漏洞
'返回值:已过滤的字符串
'============================
function safestr(str)
resultstr = replace(trim(str), "'", "")
resultstr = replace(resultstr, ";", "")
'resultstr = replace(resultstr, "-", "")
resultstr = replace(resultstr, "=", "")
resultstr = replace(resultstr, "<", "")
resultstr = replace(resultstr, ">", "")
resultstr = replace(resultstr, "(", "")
resultstr = replace(resultstr, ")", "")
resultstr = replace(resultstr, "[", "")
resultstr = replace(resultstr, "]", "")
resultstr = replace(resultstr, " ", "")
safestr = resultstr
end function
'===========================
'函数名:checksql(str)
'参数:字符串
'功能:对STR进行过滤,去掉一些特殊符号,防止sql注射漏洞
'返回值:如果有为真,否则为假!
'============================
function checksql(str)
Badword="select∥update∥chr∥delete∥from∥;∥insert∥mid∥master.∥set"
Chk_badword=split(Badword,"∥")
checksql=False
for i=0 to ubound(Chk_badword)
If Instr(LCase(str),Chk_badword(i))<>0 Then
checksql=True
exit for
end if
next
end function
'===========================
'函数名:deletefile(filename)
'参数:字符串
'功能:删除文件
'返回值:无
'============================
function deletefile(filename_str)
filename=server.MapPath(filename_str)
if filename<>"" then
set fso=server.CreateObject("scripting.filesystemobject")
if fso.FileExists(filename) then
fso.DeleteFile filename
end if
set fso=nothing
end if
end function
Function ToInt(a)
If IsNumeric(a) Then
ToInt=CLng(a)
Else
ToInt=0
End If
End Function
'=======================================================
Function ToDbl(a)
If IsNumeric(a) Then
ToDbl=Cdbl(a)
Else
ToDbl=0
End If
End Function
'=======================================================
Function GetRndFileName(sExt)
Dim sRnd
Randomize
sRnd = Int(900 * Rnd) + 100
GetRndFileName = year(now) & month(now) & day(now) & hour(now) & minute(now) & second(now) & sRnd & "." & sExt
End Function
'===========================================================================
sub print(a,b,c)
if a=b then
response.write c
end if
end sub
'=============================================================================
'显示一个大类下的下类(下拉列表)
'参数: 表单名一定要为editform
'default:默认选定值;upid:上一级类别代码(0代表大类);classtable:分类表
'============================================================================
function showclass(default,upid,classtable)
opt=""
checked=""
upid=toint(upid)
classtable=safestr(classtable)
if classtable<>"" then
opt="select * from " & classtable & " where upid=" & upid
set rs1= Server.CreateObject("ADODB.Recordset")
rs1.open opt,conn,1,1
opt=""
do Until rs1.eof
if rs1("id")=default then
checked=" selected"
else
checked=""
end if
opt=opt&""&vbCrLf
rs1.movenext
loop
rs1.close
set rs1=nothing
end if
showclass=opt
end function
'===================================================
function classjava(classtable)
tmpstr=""
classtable=safestr(classtable)
if classtable<>"" then
set adors=server.createobject("adodb.recordset")
tmpstr = "select * from "&classtable&" where upid<>0"
adors.open tmpstr,conn,1,1
tmpstr=""
tmpstr=tmpstr&" "&vbcrlf
end if
classjava=tmpstr
end function
Function Gettaxno(a)
Set objRegExp = New RegExp
a = Trim(a)
a = Left(a, 15)
a = UCase(a)
objRegExp.Pattern = "\d{6}[A-Z0-9]{9}"
objRegExp.IgnoreCase = True
objRegExp.Global = True
If objRegExp.Test(a) Then
Gettaxno = a
Else
Gettaxno = ""
End If
End Function
Function CStrDbl(a)
If a > 0 And a < 1 Then
CStrDbl = "0" & CStr(a)
Else
If a > -1 And a < 0 Then
CStrDbl = "-0" & CStr(Abs(a))
Else
CStrDbl = CStr(a)
End If
End If
End Function
%>
<%
mytable="Houseclass" '要操作的表
response.Write classjava(mytable)
on error resume next%>
| 楼盘搜索 |
")
fString = Replace(fString, CHR(10), "
")
HTMLEncode = fString
end if
end function
'=================================
'函数名:nohtml(str)
'参数:str(字串)
'功能:去除HTML标记,返回文本字串
'=================================
function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(\<.[^\<]*\>)"
str=re.replace(str," ")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
nohtml=str
set re=nothing
end function
'===============================
'函数名:HTMLcode(Content)
'参数:字符串
'功能:返回HTML代码
'===============================
function HTMLcode(Content)
if not isnull(Content) then
Content = Replace(Content, " "," ")
Content = Replace(Content, ">", ">")
Content = Replace(Content, "<", "<")
Content = Replace(Content, "\", "\\")
Content = Replace(Content, vbCrLf, "
")
Content = Replace(Content, CHR(10), "
")
Content = Replace(Content, CHR(34), """)
Content = Replace(Content, CHR(39), "'")
HTMLcode = Content
end if
end function
'==============================
'过程名:ShowMsg(Msg,URL)
'参数:字串,要输出的参数;地址,如果为"BACK"则返回上一页
'功能:在客户端输出警告消息,跳转至URL
'==============================
Sub ShowMsg(Msg,URL)
response.write "" & VbCRLF
End Sub
'===========================
'函数名:checkpost()
'参数:无
'功能:判断是否为本站提交的url
'返回值:如果为本站的返回为Ture,否则为Flase
'============================
function checkpost()
dim server_str1,server_str2
checkpost=false
server_str1=cstr(request.servervariables("http_referer"))
server_str2=cstr(request.servervariables("server_name"))
if mid(server_str1,8,len(server_str2))=server_str2 then
checkpost=True
end if
end function
'===========================
'函数名:safestr(str)
'参数:字符串
'功能:对STR进行过滤,去掉一些特殊符号,防止sql注射漏洞
'返回值:已过滤的字符串
'============================
function safestr(str)
resultstr = replace(trim(str), "'", "")
resultstr = replace(resultstr, ";", "")
'resultstr = replace(resultstr, "-", "")
resultstr = replace(resultstr, "=", "")
resultstr = replace(resultstr, "<", "")
resultstr = replace(resultstr, ">", "")
resultstr = replace(resultstr, "(", "")
resultstr = replace(resultstr, ")", "")
resultstr = replace(resultstr, "[", "")
resultstr = replace(resultstr, "]", "")
resultstr = replace(resultstr, " ", "")
safestr = resultstr
end function
'===========================
'函数名:checksql(str)
'参数:字符串
'功能:对STR进行过滤,去掉一些特殊符号,防止sql注射漏洞
'返回值:如果有为真,否则为假!
'============================
function checksql(str)
Badword="select∥update∥chr∥delete∥from∥;∥insert∥mid∥master.∥set"
Chk_badword=split(Badword,"∥")
checksql=False
for i=0 to ubound(Chk_badword)
If Instr(LCase(str),Chk_badword(i))<>0 Then
checksql=True
exit for
end if
next
end function
'===========================
'函数名:deletefile(filename)
'参数:字符串
'功能:删除文件
'返回值:无
'============================
function deletefile(filename_str)
filename=server.MapPath(filename_str)
if filename<>"" then
set fso=server.CreateObject("scripting.filesystemobject")
if fso.FileExists(filename) then
fso.DeleteFile filename
end if
set fso=nothing
end if
end function
Function ToInt(a)
If IsNumeric(a) Then
ToInt=CLng(a)
Else
ToInt=0
End If
End Function
'=======================================================
Function ToDbl(a)
If IsNumeric(a) Then
ToDbl=Cdbl(a)
Else
ToDbl=0
End If
End Function
'=======================================================
Function GetRndFileName(sExt)
Dim sRnd
Randomize
sRnd = Int(900 * Rnd) + 100
GetRndFileName = year(now) & month(now) & day(now) & hour(now) & minute(now) & second(now) & sRnd & "." & sExt
End Function
'===========================================================================
sub print(a,b,c)
if a=b then
response.write c
end if
end sub
'=============================================================================
'显示一个大类下的下类(下拉列表)
'参数: 表单名一定要为editform
'default:默认选定值;upid:上一级类别代码(0代表大类);classtable:分类表
'============================================================================
function showclass(default,upid,classtable)
opt=""
checked=""
upid=toint(upid)
classtable=safestr(classtable)
if classtable<>"" then
opt="select * from " & classtable & " where upid=" & upid
set rs1= Server.CreateObject("ADODB.Recordset")
rs1.open opt,conn,1,1
opt=""
do Until rs1.eof
if rs1("id")=default then
checked=" selected"
else
checked=""
end if
opt=opt&""&vbCrLf
rs1.movenext
loop
rs1.close
set rs1=nothing
end if
showclass=opt
end function
'===================================================
function classjava(classtable)
tmpstr=""
classtable=safestr(classtable)
if classtable<>"" then
set adors=server.createobject("adodb.recordset")
tmpstr = "select * from "&classtable&" where upid<>0"
adors.open tmpstr,conn,1,1
tmpstr=""
tmpstr=tmpstr&" "&vbcrlf
end if
classjava=tmpstr
end function
Function Gettaxno(a)
Set objRegExp = New RegExp
a = Trim(a)
a = Left(a, 15)
a = UCase(a)
objRegExp.Pattern = "\d{6}[A-Z0-9]{9}"
objRegExp.IgnoreCase = True
objRegExp.Global = True
If objRegExp.Test(a) Then
Gettaxno = a
Else
Gettaxno = ""
End If
End Function
Function CStrDbl(a)
If a > 0 And a < 1 Then
CStrDbl = "0" & CStr(a)
Else
If a > -1 And a < 0 Then
CStrDbl = "-0" & CStr(Abs(a))
Else
CStrDbl = CStr(a)
End If
End If
End Function
%>
<%
mytable="Houseclass" '要操作的表
response.Write classjava(mytable)
on error resume next%>
| 楼盘搜索 |
|
|
网站咨询电话:0833-2982371 联系邮箱:linf98@tom.com
Copyright © 2003 LSFC.net.cn All
Rights Reserved.版权所有