How to validate a single checkbox using PHP & MySQL

后端 未结 2 1256
迷失自我
迷失自我 2020-12-21 11:21

I was wondering how can I validate a single checkbox using PHP and MySQL.

Here is the HTML.



        
2条回答
  •  悲&欢浪女
    2020-12-21 12:10

    Although you have asked for PHP validation, you should probably provide javascript validation on the client site as well as PHP validation. This provides a more rapid response than server side validation.

    It's important to have both because

    • users may not have javascript turned on
    • you can't trust anything from the client side anyway :)

    If you're using jQuery for anything else, the jQuery Validation plugin makes client side validation very straightforward.

提交回复
热议问题