Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ajax post to php with params on android

$
0
0

I am doing a simple post with parameters to a php page. It works great with IOS, but on android php cannot access the post variables (if android is even sending any). Can anyone see what might be wrong in this code? Thank you for any help...

Titanium Code:

var url = 'path to php page';
 
var params = {
    ActionType : "Approve"
};
 
var xhr = Ti.Network.createHTTPClient();
 
xhr.open("POST", url);
 
xhr.onload = function() {
    alert(this.responseText);
};
 
xhr.onerror = function(e) {
    var error_msg = Ti.API.error(e.error);
    alert(error_msg);
};
 
xhr.send(params);
PHP Code:
<?php
echo $_POST["ActionType"];
?>

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>