Get http request object


>                               getHTTPRequestObject: function() 
>                               {
>                                       try { return new XMLHttpRequest(); } 
> catch(e) {}
>                                       try { return new 
> ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (f) {}
>                                       try { return new 
> ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (g) {}
>                                       try { return new 
> ActiveXObject("Msxml2.XMLHTTP"); } catch (h) {}
>                                       try { return new 
> ActiveXObject("Microsoft.XMLHTTP"); } catch (i) {}
>                                       return null;
>                               },

Send the request


>                                         var obj = {p1: 10, p2: "123"};
>                                         var params = "params=" +
> qx.lang.Json.stringify(obj);
>                                       httpRequest.open("POST", 
> "http://yoursite/yourpage.php";, true);
>                                       
> httpRequest.setRequestHeader("Content-type",
> "application/x-www-form-urlencoded");
>                                       
> httpRequest.setRequestHeader("Content-length", params.length);
>                                       
> httpRequest.setRequestHeader("Connection", "close");
>                                       httpRequest.onreadystatechange = 
> function ()
>                                        { 
>                                             // You can receive http
> response here if you need to
>                                        }
> 
>                                       httpRequest.send(params);

Now the server side:


> <?php
> 
> $params = $_POST['params'];
> $obj = json_decode($params, true);
> 
> $p1 = $params['p1'];
> $p2 = $params['p2'];
> 
> // Some code to save the params to DB
> 
> // If you need to return something back to client
> die('return value');
> 
> ?>





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Add-users-to-mysql-tp7581619p7581626.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to