First of all, let's try running your example, your mail data is json and the data type is json, but your CI implementation has access to post variables.
A quick and dirty fix is ββto send the uri string to the message data, for example:
&headline=test%20headline&article=test%20article
This can be generated from the form using the jquery serialization function:
var myData = $('#form-id').serialize();
This post data will be set to $ _POST var upon presentation, and then later accessible through the CI column function:
$this->input->post()
* Note: remember to remove the dataType parameter in the ajax call for this.
For a more politically correct solution to this problem, you will want to leave your javascript alone (all is good), but you need to configure the CI backend as a RESTful service, the default controller and input classes will not cope with this. You need to use something like Phil Sturgeon REST implementation:
- There is a github project for code,
- A blog post (read this first - this is a good short tutorial on REST servers for using CI)
- And the tutorial that you already know about.
- Oh and video when setting up.
Louis source share