We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

chaac

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Send Data PHP #21605
    chaac
    Participant

    ok, i have the solution!! :yahoo:
    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 all ;-)

    if (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.

    in reply to: Send Data PHP #21602
    chaac
    Participant

    It’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.

    in reply to: Send Data PHP #21577
    chaac
    Participant

    yes, 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 :yes:
    I also get a feedback about the 3d scene.. only no POST is transmitted. :unsure:

    in reply to: Send Data PHP #21499
    chaac
    Participant

    yes, localhost:80 (xampp-server)

    in reply to: Send Data PHP #21496
    chaac
    Participant

    like this .. no :-(

Viewing 5 posts - 1 through 5 (of 5 total)