Page 721 - 3-2
P. 721

String name = (String) params[0];
                                String id = (String) params[1];
                                String password = (String) params[2];


                                String link = "http://192.168.0.76/member.php";
                                String   data   =    URLEncoder.encode("name",      "UTF-8")    +    "="    +
            URLEncoder.encode(name, "UTF-8");
                                data   +=    "&"    +    URLEncoder.encode("id",    "UTF-8")     +   "="    +
            URLEncoder.encode(id, "UTF-8");
                                data  +=   "&"   +   URLEncoder.encode("password",     "UTF-8")   +   "="   +
            URLEncoder.encode(password, "UTF-8");


                                URL url = new URL(link);
                                URLConnection conn = url.openConnection();


                                conn.setDoOutput(true);
                                OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());


                                wr.write(data);
                                wr.flush();


                                BufferedReader         reader        =        new         BufferedReader(new
            InputStreamReader(conn.getInputStream()));


                                StringBuilder sb = new StringBuilder();
                                String line = null;


                                // Read Server Response
                                while ((line = reader.readLine()) != null) {
                                    sb.append(line);
                                    break;
                                }
                                return sb.toString();
                            } catch (Exception e) {
                                return new String("Exception: " + e.getMessage());
                            }
                        }
                    }
                    InsertData task = new InsertData();
                    task.execute(name, id, password);
                }
            }


            -----------------------------------------------------------




                                                         - 721 -
   716   717   718   719   720   721   722   723   724   725   726