Code igniter get ajax value from view to controller

后端 未结 4 1780
忘了有多久
忘了有多久 2021-01-07 06:39

How do I get send in my controller? This is what, I have tried out:

Ajax

$.ajax({
    type: \"POST\",
    url: \"e         


        
4条回答
  •  伪装坚强ぢ
    2021-01-07 07:27

    You should specify the value to be posted with the send i.e. it should be like-

    $.ajax({
        type: "POST",
        url: "example/name",
        data: 'send='+1,
        success: function(value) {
    
        }
    });
    

    Then you will have the value of this variable as you are doing.

    using-

    $this->input->post('send');
    

提交回复
热议问题