The ultimate clean/secure function

后端 未结 7 2265
忘掉有多难
忘掉有多难 2020-11-22 03:11

I have a lot of user inputs from $_GET and $_POST... At the moment I always write mysql_real_escape_string($_GET[\'var\'])..

I

7条回答
  •  后悔当初
    2020-11-22 03:47

    You're looking for filter_input_array(). However, I suggest only using that for business-style validation/sanitisation and not SQL input filtering.

    For protection against SQL injection, use parametrised queries with mysqli or PDO.

提交回复
热议问题