Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

sending post data to php

brand new to titanium, been playing with it for about an hour. can someone tell me how to send POST data from an html form into PHP? and please, be detailed, im new and im having a hard time understanding from the little code snippets im seeing. thanks!

— asked May 29th 2010 by james vandenabeele
  • desktop
0 Comments

3 Answers

  • you would normally use the XHR client

    var xhr = Ti.Network.createHttpClient();
    xhr.onreadystatechange=function()
    {
        if (this.readyState==4) {
            // post completed
        }
    };
    xhr.open("POST","http://my.com/url.php");
    xhr.send("key=value&pair=boo");
    
    — answered May 29th 2010 by Jeff Haynie
    permalink
    0 Comments
  • Ok, but what about when i have file on a local machine? I don't have http server and i want to send some data to some file in resource directory ?
    for example:

    i have two files: index.php and index2.php. I want to send post data from form from index.php to index2.php without http server ?

    — answered October 1st 2010 by Adam Wiśniewski
    permalink
    0 Comments
  • Ok, but what about when i have file on a local machine? I don't have http server and i want to send some data to some file in resource directory ?
    for example:

    i have two files: index.php and index2.php. I want to send post data from form from index.php to index2.php without http server ?

    — answered October 1st 2010 by Adam Wiśniewski
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.