I am using CodeIgniter and i am trying to retrieve some data using AJAX POST, but the controller can't read the post data that i am sending to it. 

this is the ajax call:

```
$("#notifica").click(function(){
    var mydata = '<?php echo $this->session->userdata('username'); ?>';

    $.ajax({
         type: 'POST',
         url: '<?php echo base_url(); ?>notification_navbar/notifications',
         contentType: 'text',
         dataType : 'text',
         cache:false,
         data: mydata,
        success: function(msg){
            console.log('dsada');
           $(".notifi").html(msg);
        }
    });   
}); 

```

and here is the controller: 

```
class notification_navbar extends CI_Controller{

    function notifications(){
        $hello = 'hello world';
        var_dump($this->input->post());
        exit;
        echo $hello;
    }

}

```

the error that I am taking is that the var\_dump is empty so I take false there!

The solution to the problem is that: 
i must change base\_url to site\_url