PHP: $_GET and $_POST in functions?

前端 未结 3 2077
滥情空心
滥情空心 2020-11-30 14:13

I am flabbergasted by the code, where the GET-values, such as $_GET[\'username\'], are not included as parameters to functions.

When do you need to inc

3条回答
  •  长情又很酷
    2020-11-30 14:35

    You don't need to send them as function parameters as they are global variables (accessible everywhere in the code).

    But it's always a good practice to filter and validate them before you use them in your code.

提交回复
热议问题