Sanitizing user's data in GET by PHP

前端 未结 5 952
情歌与酒
情歌与酒 2020-11-28 18:58

How do you sanitize data in $_GET -variables by PHP?

I sanitize only one variable in GET by strip_tags. I am not sure whether I should

5条回答
  •  野性不改
    2020-11-28 19:36

    You must sanitize all requests, not only POST as GET.

    You can use the function htmlentities(), the function preg_replace() with regex, or filter by cast:

    
    

    []'s

提交回复
热议问题