放在conn.asp里就行了。 '屏蔽通过地址栏攻击 url=Request.ServerVariables("QUERY_STRING") if instr(url,";")>=1 then url=Replace(url,";",";") : Response.Redirect("?" & url) end if '屏蔽通过表单攻击 for each item in request.form stritem=lcase(server.HTMLEncode(Request.form(item))) if instr(stritem,"select ")>=1 or instr(stritem,"insert ")>=1 or instr(stritem,"update ")>=1 or instr(stritem,"delete ")>=1 or instr(stritem,"exec ")>=1 or instr(stritem,"declare ")>=1 then response.write ("对不起,请不要输入非法字符!") response.end end if next
推荐阅读
从数据库中读取记录横向排列
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <% do while not rs.eof %> <tr> <td height="80"><img src="<%= rs("图片")%>" width="160" height="80"></td> </t>>>详细阅读
本文标题:一段asp防注入的通用脚本
地址:http://www.17bianji.com/kaifa2/ASP/32269.html
1/2 1