Add users to mysql

classic Classic list List threaded Threaded
8 messages Options
kay
Reply | Threaded
Open this post in threaded view
|

Add users to mysql

kay
Hi there,

I want to add users to mysql database using PHP and qooxdoo,I have no idea where to start.can someone help me
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

deniska
I'm doing something similar right now.

I'm using qooxdoo for GUI, AJAX calls to pass the parameters to server and PHP to store parameters in the database. Basically you use java script to wrap up parameters and pass them to the server via AJAX (HttpRequest call) with POST/GET, on server side PHP script parses the parameters (I'm using JSON) and stores them in the DB.
kay
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

kay
deniska can you give me example of your code,I just want to have an idea
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

deniska
I will as soon as I get home from work.
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

deniska
In reply to this post by kay
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');

?>
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

Loren Schlomer
Qooxdoo offers a wonderful IO package taking care of all the XHR stuff
for you...

http://demo.qooxdoo.org/current/apiviewer/#qx.io.request.Xhr


Just as a note, qooxdoo provides convenience for nearly everything you
want to do with javascript...  Always check the docs first. :)


And another side note, take steps to cleanse your $_POST data before
executing anything on the database...





On Tue, Oct 9, 2012 at 1:56 PM, deniska <[hidden email]> wrote:

> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

Roman Gratchev
Also you do not refuse to read the documentation for the class
http://demo.qooxdoo.org/current/apiviewer/#qx.io.remote.Rpc

see offers developers exchange format
http://manual.qooxdoo.org/current/pages/communication/rpc.html

and as an example backend implemented in the required language
http://qooxdoo.org/contrib/project#backend

good luck :)

10.10.2012, в 1:36, Loren Schlomer <[hidden email]> написал(а):

> Qooxdoo offers a wonderful IO package taking care of all the XHR stuff
> for you...
>
> http://demo.qooxdoo.org/current/apiviewer/#qx.io.request.Xhr
>
>
> Just as a note, qooxdoo provides convenience for nearly everything you
> want to do with javascript...  Always check the docs first. :)
>
>
> And another side note, take steps to cleanse your $_POST data before
> executing anything on the database...
>
>
>
>
>
> On Tue, Oct 9, 2012 at 1:56 PM, deniska <[hidden email]> wrote:
>> 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
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
kay
Reply | Threaded
Open this post in threaded view
|

Re: Add users to mysql

kay
Thanks Guys