Hi guys can you please help me, I was just wondering what to put on the php for my radio buttons this is what I did. I'm not sure if it's right. Also I have an "other" option where you will type in the answer I was wondering if I was right to put it in the $fields ?
HTML
<label class="radio-inline" style="padding-left:30px;">
<input type="radio" value="retailer" name="optradio" required>
<?PHP print $retailer; ?>Retailer
</label>
<label class="radio-inline">
<input type="radio" value="wholesaler" name="optradio">
<?PHP print $wholesaler; ?>Wholesaler
</label>
<label class="radio-inline">
<input type="radio" value="distributor" name="optradio">
<?PHP print $distributor; ?>Distributor
</label>
<label class="radio-inline">
<input type="radio" value="ebayamazonplay" name="optradio">
<?PHP print $ebayamazonplay; ?>Ebay / Amazon / Play Trader
</label>
<label class="radio-inline">
<input type="radio" value="online" name="optradio">
<?PHP print $online; ?>Online Retailer
</label>
<label class="radio-inline">
<input type="radio" value="other" name="optradio">
<?PHP print $other; ?>Other - Please specify
</label>
<input id="form_other" type="text" name="other" class="form-control" placeholder="Please specify">
PHP
$retailer = 'unchecked';
$wholesaler = 'unchecked';
$distributor = 'unchecked';
$ebayamazonplay = 'unchecked';
$online = 'unchecked';
$other = 'unchecked';
if (isset($_POST['Submit1'])) {
$selected_radio = $_POST['optradio'];
if ($selected_radio = = 'retailer') {
$retailer = 'checked';
}
else if ($selected_radio = = 'wholesaler') {
$wholesaler = 'checked';
}
if ($selected_radio = = 'distributor') {
$distributor = 'checked';
}
else if ($selected_radio = = 'ebayamazonplay') {
$ebayamazonplay = 'checked';
}
if ($selected_radio = = 'online') {
$online = 'checked';
}
else if ($selected_radio = = 'other') {
$other = 'checked';
}
ALSO, what should I put on $from? I understand that I need to put the receiver's email in $to, but why do I have to put where it's from when different people are going to submit the form? Can I just get rid of it? Will it affect something?