POST does not arrive on the server
POST does not arrive on the server
Hello together!
I create my data on the server and return a JSON array (iPad_infos.php). This works!
Now when I want to send input fields of a form to my iPad_infos.php file, I do it like this:
"ajax": {
"url": "/modules/ipads/_functions/iPad_infos.php",
"type" : "POST",
"data" : function ( d ) {
return $('#FilterForm').serialize();
},
"dataType": "json",
"dataSrc": "",
"cache": false,
"contentType": "application/json; charset=utf-8"
},
In the Firefox console I can also see "Type=WiFi&Owner=true" on request. So far good.
But when I want to read the value of Type or Owner in my iPad_infos.php with $_POST["Type"] or $_POST["Owner"], the variables are not there!
When I call the iPad_infos.php from another AJAX request, I can read the passed values without problems.
Where is my error?
Greetings!
This question has an accepted answers - jump to answer
Answers
You could try adding both those values separately, like one of the first two examples on
ajax.data
. Could you try that please, and see if any success,Colin
Hey Colin!
I have tried this:
(i.e. as in the example).
According to the Firefox Web Console, this is also transmitted (request content "user_id=451").
in my ipad_infos.php I have the following:
And get as response:
Value POST:
GET value:
array(0) { }
NULL
I just don't understand it!
I made it work!!!
Was the error. After I took it out of the JS it worked!
Ah, good find! Thanks for reporting back,
Colin