asp中如何过滤到单引号

时间:2009-07-05 18:38:00 

sql="select * from admin where users='"&users&"'and pwd='"&pwd&"'"

and前边的单引号后边应该加个空格:

sql="select * from admin where users='"& users &"' and pwd='"& pwd &"'"

过滤单引号的话,将一个单引号替换为两个

sql="select * from admin where users='"& replace(users,"'","''") &"' and pwd='"& replace(pwd,"'","''") &"'"

Replace(request.Form("user"), "'", "''") 照这个改一下

tStr=Replace(tStr, "'", "")

这样子过滤掉tStr里的单引号

所以你写的程序没有错误

标签:asp,单引号,过滤
0
投稿

猜你喜欢

  • Python函数的默认参数设计示例详解

    2021-03-23 04:31:58
  • javascript数组的使用

    2024-06-07 15:25:37
  • Python Matplotlib绘制多子图详解

    2021-01-11 11:27:05
  • Oracle数据库索引的维护

    2010-07-26 13:29:00
  • Python使用add_subplot与subplot画子图操作示例

    2022-12-15 13:14:28
  • 怎样在JavaScript里写一个swing把数据插入数据库

    2024-01-20 09:26:42
  • Python实现把回车符\\r\\n转换成\\n

    2022-09-21 07:22:14
  • Pycharm配置anaconda环境图文教程

    2023-11-10 02:18:20
  • Python tornado上传文件的功能

    2022-06-01 19:33:37
  • 详解Python中的正则表达式的用法

    2023-07-25 00:23:13
  • Python的pdfplumber库将pdf转为图片的实现

    2021-08-31 20:43:27
  • python中加背景音乐如何操作

    2023-11-09 02:54:51
  • Mysql 5.7 忘记root密码或重置密码的详细方法

    2024-01-14 17:02:36
  • Python实现FTP上传文件或文件夹实例(递归)

    2021-11-21 06:05:30
  • python numpy中对ndarry按照index增删改查

    2022-01-20 22:32:25
  • Vue如何设置el-table背景透明样式

    2024-04-27 15:49:22
  • 关于Python 实现tuple和list的转换问题

    2022-02-18 21:29:03
  • python爬虫实战之最简单的网页爬虫教程

    2022-02-06 17:03:36
  • JS统计Flash被网友点击过的代码

    2024-05-03 15:06:18
  • mysql8.0忘记密码的详细解决方法

    2024-01-12 20:50:00
  • asp之家 网络编程 m.aspxhome.com