I could not make a post request from my android app, there must be some stupid error that I could see it…
HttpPost httppost = new HttpPost("http://www.smth.net/some.php");
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("pa", "555"));
nameValuePairs.add(new BasicNameValuePair("pb", "550"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
} catch (Exception e) {
//no error thrown
}
When I go to the browser and do a request to
http://www.smth.net/some.php?ga=15523&ga=34515
only the Get values are inserted which is okey.
mysql_query("INSERT INTO t1 (a,b) VALUES (" . $_GET["ga"] . "," . $_GET["gb"] . ")");
mysql_query("INSERT INTO t1 (a,b) VALUES (" . $_POST["pa"] . "," . $_POST["pb"] . ")");
Try this and let me know what happen,
And check response, What you get..