[eluser]seegan[/eluser]
[quote author="GrahamDj28" date="1356884140"]You call the getCookie function to get the token value that has been set by CI.
Then you add the token to your data set that you are posting. Just as you have added the variable name, you add an extra variable containing the token.
Code:
$('#getdata').click(function(){
var name= "johns";
var my_csrf_token = getCookie(cookie_name);
$.ajax({
url: '<?php base_url() ?>message/sam',
type: 'POST',
dataType: 'json',
data: {
name: name,
csrf_token: my_csrf_token // The key name must match the name in your CI config file
},
success: function(output_string){
$('#result_table').append(output_string);
} // End of success function of ajax form
}); // End of ajax call
});
I think you should be able too figure this out now[/quote]
Woow thankyou man my problem solved..
Thankyou very much..