Skip to content
Advertisement

Retrieve JSON POST data in CodeIgniter

I have been trying to retrieve JSON data from my php file.Its giving me a hard time.This is my code

Code in my VIEW:

JavaScript

Trying to retrieve in my Controller:

JavaScript

Outputs Nothing.

Here are my headers:

JavaScript

My Response which I can See in Developer tools:

JavaScript

But in browser, the output is nothing. I am trying to solve it for more than 4 hours now but in vain.

JavaScript

My View Code:

JavaScript

Controller Code:

JavaScript

Advertisement

Answer

General method I use for my Ajax Calls in CI :

JS :

JavaScript

Controller :

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement