0
我試圖從我的Android應用程序上傳數據到PHP,但是,我沒有收到server.i的數據嘗試回顯數據,任何人都可以幫助這個代碼,我我沒有得到任何錯誤無法發送數據從Android到PHP
nameValuePairs.add(new BasicNameValuePair("trip_id",x));
nameValuePairs.add(new BasicNameValuePair("loc_lat",String.valueOf(location.getLatitude())));
nameValuePairs.add(new BasicNameValuePair("loc_lon",String.valueOf(location.getLongitude())));
HttpClient httpclient=new DefaultHttpClient();
HttpPost httppost=new HttpPost("http://xx/x.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response=httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
你能夠在php腳本中獲取數據嗎? –
沒有iam無法獲取php腳本中的數據 – RAHUL