ASP替换字符

前端之家收集整理的这篇文章主要介绍了ASP替换字符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<%
 '用户输入非法字符
 dim checkstring(3)
 checkstring(0) = "'"
 checkstring(1) = " "
 checkstring(2) = ";"
 checkstring(3) = ":"
 
 '替换用户输入的非法字符 stringarray 非法字符数组 checkstring 需检查的字符串
 function ReplaceString(stringarray,checkstring)
 
  for i=0 to ubound(stringarray)
   checkstring = Replace(checkstring,stringarray(i),"")
  next
  
  ReplaceString = checkstring
  
 end function
%>
uid = ReplaceString(checkstring,Request.Form("loginname"))
upwd = ReplaceString(checkstring,Request.Form("password"))

猜你在找的Asp相关文章