views:

40

answers:

1

I've gotten HTTP POST to send strings to the server side PHP script. My log is showing the correct return values. The script runs fine manually from the browser and inserts a new db table row. But can't get the script to run by having the apk call it... though, again, it returns all script page content including strings.

How can I get the script to run?

Thanks Allen

A: 

Sounds like your dealing with a cahceing issue. try adding a timestamp to the end of the url.

w-ll
Here's the code... HttpClient httpclient = new DefaultHttpClient(); String url = MgActivity.SERVER_PREFERENCES_URL; HttpPost httppost = new HttpPost(url); ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair(USERID_KEY, user)); nameValuePairs.add(new BasicNameValuePair(PREF_PAINTING_KEY, prefPainting)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost);
artworthy
Here's the code for the post... perhaps helpful:
artworthy