제가 안드로이드에서 post 방식으로 Data를 보내려고 합니다


자신이 만든 홈페이지가 아닌곳에 post 전송하여 결과값을 받으려 하는경우..


저희 동네 도서관을 연습삼아 하고 있습니다..


그런데 이 아래의 링크들을 테스트 하려는데 감이 안오고


웹쪽에 지식이 별로 없어 질문을 드립니다.


http://www.ealib.or.kr/eplib2/user/search/search.php?search_id=1 이주소처럼


사이트내에 post로 전달하는 곳을 찾을수가 없습니다.


검색하면 분명히


http://www.ealib.or.kr/eplib2/user/search/list.php 주소로 결과값이 나오는데요..


소스보기를 통해서 php내용을 보고 제가 나름 추측해본 곳을 스크린샷을 찍어 첨부했습니다.


어떻게해야 값을 넘겨서 list.php처럼 안드로이드에서 로그로 값을 볼수 있을지.. 해야할지 감이 안옵니다..


안드로이드 소스는 이렇습니다. 나름 구글링을 해서 퍼온쏘스 입니다.


//   Http Post로 주고 받기 

    public void HttpPostData() { 

        try

              //   URL 설정하고 접속하기 

              URL url = new URL(""http://www.ealib.or.kr/eplib2/user/search/search.php?search_id=1");       // URL 설정 

              HttpURLConnection http = (HttpURLConnection) url.openConnection();   // 접속 

              //-------------------------- 

              //   전송 모드 설정 - 기본적인 설정이다 

              //-------------------------- 

              http.setDefaultUseCaches(false);                                            

              http.setDoInput(true);                         // 서버에서 읽기 모드 지정 

              http.setDoOutput(true);                       // 서버로 쓰기 모드 지정  

              http.setRequestMethod("POST");         // 전송 방식은 POST 

                     

              http.setRequestProperty("content-type", "application/x-www-form-urlencoded"); 

                      //   서버로 값 전송 

                            StringBuffer buffer = new StringBuffer(); 

              buffer.append("이부분을 어떻게 설정해야할지..난감하네요..").append("=").append(test1).append("&");                 // php 변수에 값 대입 

              buffer.append("이부분을 어떻게 설정해야할지..난감하네요.").append("=").append(test2).append("&");   // php 변수 앞에 '$' 붙이지 않는다 

              buffer.append("이부분을 어떻게 설정해야할지..난감하네요.").append("=").append(test3).append("&");           // 변수 구분은 '&' 사용  

            //  buffer.append("subject").append("=").append(mySubject); 

              OutputStreamWriter outStream = new OutputStreamWriter(http.getOutputStream(), "EUC-KR"); 

              PrintWriter writer = new PrintWriter(outStream); 

              writer.write(buffer.toString()); 

              writer.flush(); 

             

              // 서버에서 전송받기 

                     

              InputStreamReader tmp = new InputStreamReader(http.getInputStream(), "EUC-KR");  

              BufferedReader reader = new BufferedReader(tmp); 

              StringBuilder builder = new StringBuilder(); 

              String str; 

              while ((str = reader.readLine()) != null) {   

                  builder.append(str + "\n");                    

              } 

              myResult = builder.toString();                     

            ((TextView)(findViewById(R.id.editText1))).setText(myResult); 

            //Toast.makeText(Context context, "전송 후 결과 받음", 0).show(); 

        } catch (MalformedURLException e) { 

                // 

        } catch (IOException e) { 

                //  

        }   



도대체 어떻게 해야 결과를 받아올수 있을까요?