PHP Form Input Filtering

后端 未结 3 1380
逝去的感伤
逝去的感伤 2021-02-11 06:24

I am a PHP newbie and am working on a basic form validation script. I understand that input filtering and output escaping are both vital for security reasons. My question is whe

3条回答
  •  遥遥无期
    2021-02-11 06:51

    Depending on what you want to secure, the filter you call might be overactive (see comments). Injectionwise you should be safe since you're using Prepared Statements (see this answer)

    On a design note you might want to filter first, then check for empty values. Doing that you can shorten your code ;)

提交回复
热议问题