javascript - It is very tedious to verify form data on both the client and the server. How to optimize it?
PHP中文网
PHP中文网 2017-06-29 10:07:58
0
4
635

I don’t know if there is a more convenient method.

PHP中文网
PHP中文网

认证0级讲师

reply all (4)
我想大声告诉你

This is a problem of user experience
Front-end verification is to allow illegal data to report errors in time without submitting it to the server and without network requests. This experience is good because it is impossible to load and then request the server every time it is submitted

Server-side verification is for final data security to prevent illegal data entry

    扔个三星炸死你

    This is not a problem of optimization. It is better not to be lazy when passing parameters. There should be no less verification

      習慣沉默

      It is definitely safer to verify both the front and back ends.

      If you want to be lazy, just don’t verify the front end or do some simple verification. Let the back end verify and return an error message every time. But this is not an optimization.

        学霸

        Let me talk about the conclusion first, there is no way to optimize it.

        Front-end verification is mainly for user experience, without requesting the server or requesting the server without refreshing the page.
        Server-side verification is to verify the correctness and legality of the data and ensure that the data written to the database meets business requirements.

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!