I'm using plain PHP code than an PHP/MVC framework.

I want to know, is plain PHP code more prone to SQL injection than using a PHP/MVC framework?

有帮助吗?

解决方案 2

You should use mysql_real_escape_string for escaping string input parameters in a query. Use type casting to sanitize numeric parameters and whitelisting to sanitize identifiers.

A better solution would be to use prepared statements, you can do this by using PDO or mysqli.

其他提示

Plain PHP isn't more vulnerable to SQL Injection, when you know how to program it. PHP MVC Frameworks are just plain PHP aswell, written by other humans like you :).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top