search

Home  >  Q&A  >  body text

使用了html5 required,后台还需要做 不为空的验证吗

因为以前是用js做验证,但是别人禁掉js那么不为空的验证就没效了,所以后台也要加不为空的验证

但现在大部分都使用了html5 required了

那么后台还需要做不为空的验证吗?

高洛峰高洛峰2787 days ago3509

reply all(21)I'll reply

  • 阿神

    阿神2017-04-17 11:52:36

    Users can simulate browser operations and submit illegal data, which can be easily achieved with curl~

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:52:36

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:52:36

    There is something called Firebug.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:52:36

    Must be verified before and after. For a user who understands the front-end, he can maliciously attack your website.

    reply
    0
  • 迷茫

    迷茫2017-04-17 11:52:36

    The backend still needs to be verified, and the front-end data is never trustworthy

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:52:36

    What if I simulate a request?

    So I have to add it!

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 11:52:36

    It’s definitely necessary, so I’ll add one more point.
    Some mobile versions of WeChat’s built-in browser cannot be used required

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:52:36

    Of course you have to add
    your review element and then remove required and try

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:52:36

    Front-end verification is just for experience, the back-end is the real verification

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:52:36

    Front-end verification is mainly for good user experience and fast response, but it is unreliable and can be bypassed; but background verification is the real verification of data legitimacy, so any front-end verification cannot Replaces background verification.

    reply
    0
  • Cancelreply