PHP能用sprintf函数来防止SQL流入吗

WBOY
Release: 2016-06-13 12:50:09
Original
1048 people have browsed it

PHP能用sprintf函数来防止SQL注入吗?

$sql = sprintf("select count(*) as qty from t_user where f_uid='%s' and f_password='%s'",$password,$userAccount);
Copy after login

这句话能挡住SQL注入吗?

sql注入
------解决方案--------------------
不能,SQL注入的关键在于引号,而sprintf()不会去处理引号。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!