下面的代码是从aspcms系统中扒下的代码,在获取参数值与sql安全过滤参数方面做了限制代码如下:'获取参数值Function getForm(element,ftype)Select case ftypecase getgetForm=trim(request.QueryString(element))case postgetForm=trim(request.Form(element))case bothif isNul(request.QueryString(element)) then getForm=trim(request.Form(element)) else getForm=trim(request.QueryString(element))End SelectgetForm=replace(getForm,CHR(34),)getForm=replace(getForm,CHR(39),')End Function'主要功能就是获取参数值,比直接用request(element)要安全很多'过滤参数Function filterPara(byVal Para)filterPara=preventSqlin(Checkxss(Para))End FunctionFunction preventSqlin(content)dim sqlStr,sqlArray,i,speStrsqlStr=<|>|%|%27|'|''|;|*|and|exec|dbcc|alter|drop|insert|select|update|delete|count|master|truncate|char|declare|where|set|declare|mid|chrif isNul(content) then Exit FunctionsqlArray=split(sqlStr,|)for i=lbound(sqlArray) to ubound(sqlArray)if instr(lcase(content),sqlArray(i))<>0 thenselect case sqlArray(i)case <:speStr=<case >:speStr=>case ',:speStr='case ;:speStr=;case else:speStr=end selectcontent=replace(content,sqlArray(i),speStr,1,-1,1)end ifnextpreventSqlin=contentEnd Function'上面的参数过滤函主要是防止sql注入,加强的防护。