Validating radio button with php

by  |  30-Oct-2019 09:16

Be aware of that any Java Script code can be added inside the - this would not be executed, because it would be saved as HTML escaped code, like this: <script>location.href(' The code is now safe to be displayed on a page or inside an e-mail.

That could cause some issues in some browsers, especially if you are using Javascript. Also, what are you using an empty a element for (which doesn't have an href attribute, by the way)?

These pages will show how to process PHP forms with security in mind.

It is also required to add server side form validation in your form processing script.

The user can disable Javascript on their server or even auto-bots might try to submit your form as well.

The value attributes of the input elements in the HTML form are the possible values that can be stored in the $_POST['consent'] array element when a radio button is selected.

Community Discussion