Page 780 - 3-2
P. 780

String phone = (String) params[2];
                                    String password = (String) params[3];


                                    String link = "http://192.168.0.77/db4.php";
                                    String   data   =   URLEncoder.encode("id",    "UTF-8")     +    "="   +
            URLEncoder.encode(id, "UTF-8");
                                    data  +=   "&"   +  URLEncoder.encode("name",     "UTF-8")    +   "="  +
            URLEncoder.encode(name, "UTF-8");
                                    data  +=   "&"  +   URLEncoder.encode("phone",    "UTF-8")    +   "="  +
            URLEncoder.encode(phone, "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());
                                }
                            }
                        }
                        // id  입력 확인
                        if( mEditId.getText().toString().length() == 0 ) {
                            Toast.makeText(JoinActivity.this,             " 아이디를                입력하세요!",
            Toast.LENGTH_SHORT).show();
                            mEditId.requestFocus();


                                                         - 780 -
   775   776   777   778   779   780   781   782   783   784   785