下面的程式碼是從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注入,加強的防護。