求救,thinkphp开发时注意哪些安全性问题

 我来答
龙氏风采
2017-01-11 · 知道合伙人互联网行家
龙氏风采
知道合伙人互联网行家
采纳数:5849 获赞数:12819
从事互联网运营推广,5年以上互联网运营推广经验,丰富的实战经

向TA提问 私信TA
展开全部
  where方法使用字符串条件的时候,支持预处理(安全过滤),并支持两种方式传入预处理参数,例如:
  $Model->where("id=%d and username='%s' and xx='%f'",array($id,$username,$xx))->select();
  // 或者
  $Model->where("id=%d and username='%s' and xx='%f'",$id,$username,$xx)->select();
  模型的query和execute方法 同样支持预处理机制,例如:
  $model->query('select * from user where id=%d and status=%d',$id,$status);
  //或者
  $model->query('select * from user where id=%d and status=%d',array($id,$status));
  execute方法用法同query方法。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式