Php 所选单选按钮使字段为真或假

Php 所选单选按钮使字段为真或假,php,Php,我有以下代码: <?php $radioSwitch = of_get_option('radio_switch'); if ($radioSwitch == "true") { ?> <!-- radio switch --> <div class="

我有以下代码:

    <?php $radioSwitch = of_get_option('radio_switch');
                                if ($radioSwitch == "true") { ?>
                                    <!-- radio switch -->
                                    <div class="row switches clearfix">
                                        <input type="radio" name="switch" id="switch1" value="<?php echo of_get_option('switch1'); ?>" /><label for="switch1" class="field"><?php echo of_get_option('switch1'); ?></label>
                                        <input type="radio" name="switch" id="switch2" value="<?php echo of_get_option('switch2'); ?>" /><label for="switch2" class="field"><?php echo of_get_option('switch2'); ?></label>
                                    </div>
                                <?php } ?>

................................................................................


    <?php
                            $datePicker1 = of_get_option('datepicker1');
                            $datePicker2 = of_get_option('datepicker2');
                            if (($datePicker1 == "true") || ($datePicker2 == "true")) { ?>
                                <div class="row clearfix">
                                <?php if ($datePicker1 == "true") { ?>

                                    <!-- datepicker 1 -->
                                    <input type="text" id="dateFrom" name="<?php echo of_get_option('datepicker1_text'); ?>" value="<?php echo of_get_option('datepicker1_text'); ?>" tabindex="6" />
                                    <label class="error" for="dateFrom" id="dateFrom_error">Selectați data.</label>
                                <?php } ?>                  

                            <?php if ($datePicker2 == "true") { ?>

                                    <!-- datepicker 2 -->
                                    <input type="textarea" id="dateTo" name="<?php echo of_get_option('datepicker2_text'); ?>" value="<?php echo of_get_option('datepicker2_text'); ?>"  tabindex="7" />
                                    <label class="error" for="dateTo" id="dateTo_error">Selectați data.</label>
                                <?php } ?>
                                </div>
                            <?php } ?>


PHP是一种在服务器上解析的服务器端语言。不能在浏览器上修改PHP的变量

尝试将单选按钮选项作为表单提交到PHP页面中