Htmlentities vs addslashes vs mysqli_real_escape_string

前端 未结 7 1093
悲哀的现实
悲哀的现实 2020-12-18 03:04

I\'ve been doing some reading on securing PHP applications, and it seems to me that mysqli_real_escape_string is the correct function to use when inserting data

相关标签:
7条回答
  • 2020-12-18 03:51

    You could also use the PDO libs which does most of the escaping for you, in case you may use PHP5 on the servers.

    On echoing back I'd personally prefer htmlspecialchars, but one might correct me

    0 讨论(0)
提交回复
热议问题