I have created a test form just to try to send my radio button value to mysql. I am having problems with it at the moment. The code below is just a test, I want the radio bu
You should start with closing all of your tags with
or at least a slash at the end (like
).
You should set values to your radios (like this they always return 'on'
), whereas the submit button needs neither name nor value.
EDIT:
Define a default radio with selected
in yout input tag! If none is selected, there's no case
getting transmitted and PHP will throw Undefined index: case
when accessing $_POST['case']
.
A good way to prevent such errors is to check if all necessary indices are set. You can do the following:
if(isset($_POST['name']) and isset($_POST['case']) and isset($_POST['email'])) { ... }