make use of php GET and POST in android programming
<pre><code>try {
    HttpClient client = new DefaultHttpClient();  
    String postURL = "http://somepostaddress.com";
    HttpPost post = new HttpPost(postURL);
        List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
        params.add(new BasicNameValuePair("user", "kris"));
        params.add(new BasicNameValuePair("pass", "xyz"));
        UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);
        post.setEntity(ent);
        HttpResponse responsePOST = client.execute(post);  
        HttpEntity resEntity = responsePOST.getEntity();  
        if (resEntity != null) {    
            Log.i("RESPONSE",EntityUtils.toString(resEntity));
        }
} catch (Exception e) {
    e.printStackTrace();
}
</code></pre>

<p>this is the code that i found in <a href="http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests" rel="nofollow">http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests</a>. afterward i will just only use the simple POST method the variable in the php, right?</p>

<p>example:</p>

<p>$user=$_POST['user'];
$pass=$_POST['pass'];</p>

<p>however, when i execute the code, the php showed a 0 only. may i know how to solve it? thanks</p>

<p>p/s: sry for bad english</p>
