幻影英雄 拿斧头的:专门用来过滤Request的参数值是什么意思

来源:百度文库 编辑:高校问答 时间:2024/04/28 00:11:12
function GetVariable(strVariableName)
if IsEmpty(Request(strVariableName)) then
GetVariable=empty
exit Function
end if
GetVariable=Replace(Request(strVariableName),"'","''")
GetVariable=Replace(GetVariable,";","")
GetVariable=Replace(GetVariable,"--","")
end function

function GetFormVariable(strVariableName)
if IsEmpty(Request.Form(strVariableName)) then
GetFormVariable=empty
exit Function
end if
GetFormVariable=Replace(Request.Form(strVariableName),"'","''")
GetFormVariable=Replace(GetFormVariable,"--","")
end function

function GetQueryString(strVariableName)
if IsEmpty(Request.QueryString(strVariableName)) then
GetQueryString=empty
exit Function
end if
GetQueryString=Replace(Request.QueryString(strVariableName),"'","''")
GetQueryString=Replace(GetQueryString,";","")
GetQueryString=Replace(GetQueryString,"--","")
end function
function FirstMenu()
FirstMenu=0
End function

'添加会员日记
Sub LogIn(strMID,strEvent)
strSQL="Insert Into web_log(m_id,l_event,l_time) Values(" & strMID & ",'" & strEvent & "','"&now()&"')"
conn.execute strSQL
End sub

'检查会员权限
'参数:strSymbol-权限代号,栏目的代号是该栏目的ID,在线购物为sp,新闻内容为new等
Sub ChkMember(strSymbol)
'检查访问者
if Session("m_Code")="" then
strForVisitor=GetKey("Visitor",WebUserID,"member")
if Instr(strForVisitor,strSymbol)>0 then
'此页面已经被加密,拒绝访问者
ShowMsg "拒绝访问!<br><br>您不是会员或者尚未登录,[<a href=reg.asp>注册会员</a>][<a href=login.asp>登 录</a>]"
end if
end if

'检查普通会员
if Session("m_Code")="0" then
strForMember=GetKey("Member",WebUserID,"member")
if Instr(strForMember,strSymbol)>0 then
'此页面已经被加密,拒绝访问者
ShowMsg "拒绝访问!<br><br>您不是VIP会员或者尚未登录,[<a href=regvip.asp>升级VIP会员</a>][<a href=login.asp>登 录</a>]"
end if
end if

End sub

Function CutStr(Str,Gtype,lennum)
Dim p_num
Dim i,x
If strlen(Str)<=lennum Then
CutStr=str
Else
p_num=0
x=0
Do while not p_num > lennum-2
x=x+1
If asc(mid(str,x,1))<0 Then
p_num=int(p_num) + 2
Else
p_num=int(p_num) + 1
End If
If Gtype = 1 Then
CutStr=left(trim(str),x) & "..."
Else
CutStr="..." & Right(trim(str),x)
End IF
Loop
End If
End Function

'取字符串长度
Function strlen(str)
Dim p_len,xx
p_len=0
strlen=0
If trim(str)<>"" Then
p_len=len(trim(str))
For xx=1 to p_len
If asc(mid(str,xx,1))<0 Then
strlen=clng(strlen) + 2
Else
strlen=clng(strlen) + 1
End If
Next
End If
End Function
%>