Re: [qooxdoo-devel] Using Xhr object in Desktop application

2014-03-14 Thread jarous92
Hi Richard, thank you for your advice. But I don´t know how exactly save a json format from js file to php array. Example: JS File: xmlhttp.send({test: "someData", test2: "someOtherData"}); PHP File: $array = json_decode($_POST); // I want e.g. $array['test'] or $_POST['test'] or something like

Re: [qooxdoo-devel] Using Xhr object in Desktop application

2014-03-13 Thread Richard Sternagel
Hi Jaromír, one possible solution is to just "json_encode()" and then echo the data from the database similar to the test php file I used in the playground sample: https://github.com/qooxdoo/qooxdoo/blob/master/framework/source/resource/qx/test/xmlhttp/echo_post_request.php In pseudocode: B

Re: [qooxdoo-devel] Using Xhr object in Desktop application

2014-03-13 Thread jarous92
Thank you so much for advice, it works! Can I have another question? How do I read data in php file under specific variable? For example: from JS file goes to PHP 2 variables: date_from and date_to -- and I need use these variables into db query and return result (array of strings) back to JS f

Re: [qooxdoo-devel] Using Xhr object in Desktop application

2014-03-13 Thread Richard Sternagel
Hi jarous92, this should work: --- var xmlhttp = new qx.io.request.Xhr("test.php", "POST"); // can be omitted - will be set automatically // xmlhttp.setRequestHeader("Content-type", // "application/x-www-form-urlencoded"); xmlhttp.setRequestData("test=someData"); // works too // xmlhttp.setReque

Re: [qooxdoo-devel] Using Xhr object in Desktop application

2014-03-13 Thread John Spackman
Hi Is there a reason you're using qx.io.request.*? I think that's an older treatment. You could try using qx.io.remote.Request; here's an example from one of my contribs: > var req = new qx.io.remote.Request("test.php", "POST", "text/plain"); > req.setAsynchronous(false); > req.setD