Don't allow user to enter HTML tags in input

后端 未结 3 846
青春惊慌失措
青春惊慌失措 2021-01-22 04:11

I have an input which allows users to enter text, which is then sent using PHP to another page, where it is stored in a database. I have done some simple validation ( checking i

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 04:15

    You can simply use htmlspecialchars, or strip_tags before inserting into database.

    You can also use mysqli_real_escape_string or PDO::quote to secure strings

提交回复
热议问题