在注册表单中添加单选按钮


Add a Radio button in signup form

我在plus2net网站上找到了一个注册表单的完整代码(http://www.plus2net.com/php_tutorial/php_signup.php)

我需要在上面的表单中再添加一个单选按钮。请帮助我如何添加一个单选按钮,它还应该将数据写入数据库。

告诉我应该在现有代码中的哪个位置添加我的代码。

提前谢谢。

下面是现有代码:

<div class="col-md-12 margin-bottom-15">
    <label for="department" class="col-sm-2 control-label">Department</label>
        <div class="col-sm-10">
            <label class="radio-inline"><input type="radio" name="department" value="ckgs" checked> CKGS </label>
            <label class="radio-inline"><input type="radio" name="department" value="cnk"> CNK </label>
        </div>
</div>

根据您的代码:

<div class="col-md-12 margin-bottom-15">
    <label for="department" class="col-sm-2 control-label">Department</label>
        <div class="col-sm-10">
            <label class="radio-inline"><input type="radio" name="department" value="ckgs" checked> CKGS </label>
            <label class="radio-inline"><input type="radio" name="department" value="cnk"> CNK </label>
        </div>
</div>

对于第三个具有值sty的单选按钮,您只需要添加:

            <label class="radio-inline"><input type="radio" name="department" value="sty"> STY </label>
                                                                                     ^^^   ^^^
                                                Change the above to whatever value you want for the radio button.