2013-06-28 63 views

回答

0

這個工作對我試試這個:

HttpClient httpclient = new DefaultHttpClient(); 
HttpPost httppost = new HttpPost("http://URL.com.php"); 
postParameters.add(new BasicNameValuePair("param1", value1)); 
postParameters.add(new BasicNameValuePair("param2", value2)); 
httppost.setEntity(new UrlEncodedFormEntity(postParameters)); 
HttpResponse response = httpclient.execute(httppost); 
String str = inputStreamToString(response.getEntity().getContent()) 
      .toString() 
+0

謝謝,但我使用 –

+0

沒有ü解決了這個問題? – KOTIOS

+0

謝謝親愛的,我使用相同的代碼。我使用了androidhive教程。我正在使用wamp服務器。問題是:當我運行移動應用程序並顯示訂單(給定用戶的訂單是用戶參數 - )訂單顯示正確。如果重新運行相同的活動,它有時顯示空列表。因爲關聯的php腳本測試_GET('user')並且發現它爲空。我的問題是:問題來自wamp服務器還是移動應用程序?有一些配置需要完成? plz幫助, –