Forum Replies Created
-
AuthorPosts
-
chaacParticipant
ok, i have the solution!!
The function sendData() send the request Header as Content-type ‘application/json’, and strings as ‘text/plain’. Anyway.. the $_POST Array ist always empty!
On PHP we must decode the file content as json.. that’s allif (empty($_POST)) { $_POST = json_decode(file_get_contents("php://input"), true) ? : []; } print_r($_POST);
Result are an full Array!
Maybe should mention that at “send data” in the help.chaacParticipantIt’s all visible:
this.procedures[“dophp”] = dophp;
..
function dophp(VAR) {
console.log(VAR);
}
..
oActivObj = null;
registerOnClick(aAllEditableObj, function() {
objDict = getObjCustomProps(_pGlob.pickedObject);
if (dictGet(objDict, ‘activ’) == false) {
outline(aAllEditableObj, ‘DISABLE’);
oActivObj = _pGlob.pickedObject;
outline(oActivObj, ‘ENABLE’);
dictSet(objDict, ‘activ’, true);
} else {
outline(oActivObj, ‘DISABLE’);
dictSet(objDict, ‘activ’, false);
oActivObj = null;
}
sendData(objDict, ‘test.php’, function() {
dophp(_pGlob.loadedFile);
});
}, function() {});.. it all works HTML-Elements control 3d-Scene and vice versa.
In the same html run a $.ajax POST (2 Objects to test.php).. it work’s perfectly. Only the “send data” Puzzle .. send NO data.. no String, no Number, no Object .. nothing.chaacParticipantyes, all in the same folder on Webserver “http://localhost/verge3d/test.php”.
I make a Test .. switch POST to GET:
<?php var_dump(count($_GET)); ?>
Call WB: http://localhost/verge3d/test.php?test=true
Resuld: int(1) It’s running
I also get a feedback about the 3d scene.. only no POST is transmitted.chaacParticipantyes, localhost:80 (xampp-server)
chaacParticipantlike this .. no
-
AuthorPosts