Php 选中要传输到数据库的值

Php 选中要传输到数据库的值,php,codeigniter,Php,Codeigniter,我是新来的,我需要一个PHP代码的帮助 我想将单选按钮转换为复选框,使其根据选中的复选框数量计算费用,并将选中的值传输到预定义的数据库 我的代码只接受一个预定义的费用值,当我单击另一个复选框时,它实际上不会将它们相加。我什么都试过了,但没有成功。以下是未更改的原始代码: <script src="<?php echo URL_FRONT_JS;?>jquery.js"></script> <script> function get_tuto

我是新来的,我需要一个PHP代码的帮助

我想将单选按钮转换为复选框,使其根据选中的复选框数量计算费用,并将选中的值传输到预定义的数据库

我的代码只接受一个预定义的费用值,当我单击另一个复选框时,它实际上不会将它们相加。我什么都试过了,但没有成功。以下是未更改的原始代码:

<script src="<?php echo URL_FRONT_JS;?>jquery.js"></script>
<script>
    function get_tutor_course_details()
    {
        course_slug     = $('#course_slug option:selected').val();
        selected_date   = $('#start_date').val();

        if(!course_slug || !selected_date) {
            $('#fee').text('');
            $('#duration').text('');
            $('#days_off').text('');
            $('#content_li').remove();
            $('#time_slot_div').text('<?php echo get_languageword("please_select_course_and_date_first"); ?>');
            return;
        }

        $.ajax({
                type: "POST",
                url: "<?php echo URL_HOME_AJAX_GET_TUTOR_COURSE_DETAILS; ?>",
                data: { "course_slug" : course_slug, "tutor_id" : <?php echo $row->id; ?>, "selected_date" : selected_date },
                cache: false,
                beforeSend: function() {
                    $('#time_slot_div').html('<font color="#5bc0de" size="6"> Loading...</font>');
                },
                success: function(response) {

                    if(response == "") {
                        $('#fee').text('');
                        $('#duration').text('');
                        $('#days_off').text('');
                        $('#content_li').remove();
                        $('#time_slot_div').html('<?php echo get_languageword("no_slots_available."); ?> <a href="#"><?php echo get_languageword("click_here_to_send_me_your_message"); ?></a>');
                        $('#request_tutor_btn').slideUp();
                    } else {
                        var fee_duration = response.split('~');
                        var fee          = fee_duration[0];
                        var duration     = fee_duration[1];
                        var content      = fee_duration[2];
                        var time_slots   = fee_duration[3];
                        var days_off     = fee_duration[4];

                        $('#fee').text(fee +'€');
                        $('#duration').text('EUR');



                        if(content) {
                            $('#content_li').remove();
                            $('#course_li').after('<li id="content_li"><?php echo get_languageword("course_content"); ?><p>'+content+'</p></li>');
                        }

                        time_slot_html = "";
                        if(time_slots != "")
                            time_slots = time_slots.split(',');

                        total_available_timeslots = time_slots.length;

                        if(total_available_timeslots > 0) {

                            for(i=0;i<total_available_timeslots;i++) {

                                check_radio = "";
                                if(i == 0)
                                    check_radio = 'checked = "checked"'; 
                                time_slot_html += '<li><div><input id="radio1'+i+'" type="radio" name="time_slot" value="'+time_slots[i]+'" '+check_radio+' ><label for="radio1'+i+'"><span><span></span></span>'+time_slots[i]+'</label></div></li>';
                            }

                            $('#time_slot_div').html(time_slot_html);
                            $('#request_tutor_btn').slideDown();

                        } else {

                            $('#time_slot_div').html('<?php echo get_languageword("no_slots_available."); ?> <a href="#"><?php echo get_languageword("click_here_to_send_me_your_message"); ?></a>');
                             $('#request_tutor_btn').slideUp();
                        }
                    }
                }
        });

    }

对不起,我忘了写Hello erveyone!发布你的HTML代码你需要“php”代码的帮助吗?这都是js。。。php在哪里?