爱问知识人 爱问教育 医院库

JavaScript过滤SQL怎么注入字符?

首页

JavaScript过滤SQL怎么注入字符?

JavaScript过滤SQL怎么注入字符?

提交回答

全部答案

    2018-10-27 18:52:19
  •   html xmlns=http://www。w3。org/1999/xhtml headtitle标题页/titlescript LANGUAGE=JavaScriptfunction check(inputStr) { if (typeof(inputStr) != string) { return inputStr; } //判断是否是字符串类型 var tmpValue = inputStr; //以下搜索字符串中的特殊字符,如果存在,则替换成 while (tmpValue。
      indexOf(';') -1) {tmpValue = tmpValue。replace(';',''); } while (tmpValue。indexOf('') -1) {tmpValue = tmpValue。replace('',''); } while (tmpValue。
      indexOf('') -1) {tmpValue = tmpValue。replace('',''); } while (tmpValue。indexOf('--') -1) {tmpValue = tmpValue。replace('--',''); } while (tmpValue。
      indexOf(,) -1) {tmpValue = tmpValue。replace(,,); } while (tmpValue。indexOf(') -1) {tmpValue = tmpValue。replace(',); } while (tmpValue。
      indexOf(?) -1) {tmpValue = tmpValue。replace(?,); } document。getElementById(txt1)。value = tmpValue; //重新显示更改后的变量}/script/headbodyinput type=text id=txt1 value=select * from userinfo where username=zhang' and passwrod=2 style=width: 392pxinput type=button value=提交 onClick=check(txt1。
      value)/body/html。

    M***

    2018-10-27 18:52:19

类似问题

换一换

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):