Http post from android to PHP -


I am trying to Android php to httppost form via XPP. I am getting httpResponse in Android but when I try to load the URL in the browser, nothing is displayed. It only displays "no"

"I send the value from Android And when I load the url, then it should be displayed in the browser. "

  protected string doInBackground (string ... ury) {// TODO auto-generated method stub {http client http client = new default HTTP client (); Http post http post = new HTTP post (Yuri [0]); //httpPost.setHeader("Content-Type"/"application/x-www-form-urlencoded "); & Lt; NameValuePair & gt; NameValuePair = New ArrayList & lt; NameValuePair & gt; (1); NameValuePair.add (New BasicNameValuePair ("id", "somevalue")); Log.d ("debug", nameValuePair.get (0) .toString ()); UrlEncodedFormEntity ent = New UrlEncodedFormEntity (nameValuePair, HTTP.UTF_8); httpPost.setEntity (ENT); HttpResponse response = httpClient.execute (httpPost); // Answer code try {BufferedReader rd = new BufferedReader (New InputStreamReader (response.getEntity). GetContent ())); String line = ""; While ((line = rd.readLine ()) = null) {Log D. ("Reaction", line); }} Hold (Exception e) {// Code to handle exception}} Grip (Client Protocol E) {// Todo Auto-Generated Catch Block System. Outprintlines ("clientprococoloption"); } Catch (IOE EXPRESS E) {// TODO Auto-Generated Cache Block System.out.printline ("IOexception"); E.printStackTrace (); } Return tap; }   

................................

  & lt ;? Php if ($ _ POST) {print_r ($ _ POST); } And if ($ _GET) {print_r ($ _ POST); } And {echo 'no'; }? & Gt;    

  & lt ;? Php if (isset ($ _ POST ['id'])) {var_dump ($ _ POST); Copy $ _POST ['id']; // should be "some value"} and {echo 'id is not set'; }? & Gt;    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -