I am using ajax to pass my variable into a controller. I can see the result in the success function data but when I want to echo the posted variable, I don't see any value.
This is my ajax :
id = $(this).attr("id");
$.ajax({
type:'POST',
url:'mobishopp/page',
data: {
'id': id
},
success:function(data) {
alert(data);
}
});
This is my controller:
public function page()
{
$id= $this->input->post('id');
echo $id;
}