如何使用脚本将两个数据传递给Controller?

时间:2014-04-21 07:35:00

标签: javascript php

我有这样的脚本:

delete_event: function() {
    if (this.id != 0) {
        var url = base_url + "event/delete_event_data/" + this.id + this.event_id;
        location.href = url;
    }
    else {
        alert('Please Select Event');
    }
},

我想将id和事件id传递给后续控制器:

public function delete_event_data($id,$event_id) {
    $result = $this->event_model->delete_event_data($id);
    if ($result == TRUE) {
        $this->session->set_flashdata('success-msg', ' Event Data  Successfully Deleted. ');
        redirect('event');
    } else {
        $this->session->set_flashdata('failure-msg', ' ERROR! Something went Wrong. ');
        redirect('event');
    }
}

我已经完成了上面但它不起作用。
请指导我..

0 个答案:

没有答案