I have a big problem about post data to any form(any server). (by java application).
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, May 13, 2002 11:33 PM

Hi, I have a big problem about post data to any form(any server) now !. Some website can post but some website can't post !.(sometimes one url content more than one form), can you show me the way to do that, please. please write to me soon. Thank you very much. Tung ==== code ==== /* URL: http://www.uiduk.ac.kr/cgi-bin/cgiwrap/~ubic/weekyboard/weekyboard.cgi?act=write FormAction: http://www.uiduk.ac.kr/cgi-bin/cgiwrap/~ubic/weekyboard/weekyboard.cgi Query: name=name&email=email&url=homepage&pass=1234&title=subject&content=content&option=original URL: http://www.cleanwld.co.kr/board/bbs.cgi?db=board&mode=write&backdepth=1 FormAc   More>>

Hi,
I have a big problem about post data to any form(any server) now !. Some website can post but some website can't post !.(sometimes one url content more than one form), can you show me the way to do that, please.
please write to me soon.
Thank you very much.
Tung
==== code ====
/*
URL: http://www.uiduk.ac.kr/cgi-bin/cgiwrap/~ubic/weekyboard/weekyboard.cgi?act=write

FormAction: http://www.uiduk.ac.kr/cgi-bin/cgiwrap/~ubic/weekyboard/weekyboard.cgi

Query: name=name&email=email&url=homepage&pass=1234&title=subject&content=content&option=original

URL: http://www.cleanwld.co.kr/board/bbs.cgi?db=board&mode=write&backdepth=1

FormAction: http://www.cleanwld.co.kr/board/bbs.cgi

Query: pName=name&pEmail=email%40yahoo.com&url=www.homepage.co.kr&pPassword=1234&pSubject=subject&content=Content&db=board&mode=writesave&num=0&page=1&ftype=6&fval=&pAttachText=&pText=



URL: http://bizplaza.chollian.net/qna/board_insert.asp?gotopage=1&kind=qna
Url: http://bizplaza.chollian.net/qna/board_insert.asp?gotopage=1&kind=qna
strUrlTemp = FormAction: http://bizplaza.chollian.net/qna/board_insert_ok.asp
URL POST: http://bizplaza.chollian.net/qna/board_insert_ok.asp
strUrlTemp: http://bizplaza.chollian.net/qna/board_insert_ok.asp
body = Query: name=name&email=email%40yahoo.com&url=www.homepage.co.kr&passwd=1234&title=subject&content=Content&kind=qna
/*

with: body = Query
strUrlTemp = FormAction

public boolean submitData(String strUrlAddr) {
boolean flagCheck = false;
String strUrlTemp = "";
String body = "";
if(query.equals(""))
return false;

strUrlTemp = urlFormAction;
body = query;
if(!hiddenPar.equals(""))
body = query +"&"+ hiddenPar;

if(strUrlTemp.indexOf("http://") < 0)
strUrlTemp += "http://"+strUrlTemp;

System.out.println("Url: "+strUrl);
System.out.println("FormAction: "+urlFormAction);
System.out.println("URL POST: "+strUrlTemp);
System.out.println("strUrlTemp: "+strUrlTemp);
System.out.println("Query: "+body);
System.out.println("============ BEGIN ============");
try{
URL url = new URL(strUrlTemp);
HttpURLConnection urlC = (HttpURLConnection)url.openConnection();
// urlC.setRequestMethod("GET");
urlC.setAllowUserInteraction(false); // you may not ask the user
urlC.setDoOutput(true); // we want to send things
// the Content-type should be default, but we set it anyway
// urlC.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" );
urlC.setRequestProperty( "Content-type", "multipart/form-data" );
// the content-length should not be necessary, but we're cautious
urlC.setRequestProperty( "Content-length", Integer.toString(body.length()));

// get the output stream to POST our form data
OutputStream rawOutStream = urlC.getOutputStream();
PrintWriter pw = new PrintWriter(rawOutStream);

pw.print(body); // here we "send" our body!
pw.flush();
pw.close();

// get the input stream for reading the reply
// IMPORTANT! Your body will not get transmitted if you get the
// InputStream before completely writing out your output first!
InputStream rawInStream = urlC.getInputStream();

// get response
BufferedReader rdr = new BufferedReader(new InputStreamReader(rawInStream));
String line = "";

while ((line = rdr.readLine()) != null) {
System.out.println(line.trim());
}
rdr.close();
}catch(Exception e){
e.printStackTrace();
}

System.out.println("============ END ============");
return flagCheck;
}

================== this is list url content form
http://bizplaza.chollian.net/qna/board_insert.asp?gotopage=1&kind=qna
http://www.os119.co.kr/osp/board/bbs_write.asp
http://www.japangi.com/admin/userqa/postform.php?code=phpboard
http://www.uiduk.ac.kr/cgi-bin/cgiwrap/~ubic/weekyboard/weekyboard.cgi?act=write
http://tbi.inhatc.ac.kr/jsboard/write.php?table=qanda&page=1
http://www.okhelp.co.kr/pan/write.asp
http://bi.sunlin.ac.kr/webboard/bbs/write-form.asp
http://www.cleanwld.co.kr/board/bbs.cgi?db=board&mode=write&backdepth=1
http://www.venture-business.com/pds/write-form.asp?name=bbs&page=1
http://211.35.26.6/bic/zboard/member_join.php?id=free&page=1&category=&sn=off&ss=on&sc=on&keyword=&select_arrange=headnum&desc=asc
http://www.naraydnc.co.kr/board/webboard_02.asp?sw=d&b_type=1
http://www.changup2002.com/changfranchase/board/bbs_write.asp?l_sort=food
http://www.ttscun.co.kr/board/board_new.html?code=tts_cyber
http://www.nicepoll.co.kr/board/admincheck.asp?userchk=20010713114308&homeurl=&page=1&method=write
http://kimcokorea.com/way-board/way-board.cgi?db=qna&j=tm&no=146&pg=1
http://kingdomofstory.com/cgi-bin/duri_board/main.cgi?board=dialog_adv&command=write_form
http://www.giftfarm.co.kr/index/feedback/write.asp
http://board4.cgiworld.net/write.cgi?id=eureka2&jd=-1
http://changup.co.kr/way-board/way-board.cgi?db=news&j=w&pg=1
http://board.jinsol.com/board/storyboard.cgi?db=kortrading1&mode=write&backdepth=1
http://www.dodam21.co.kr/board_01/write.asp
http://board11.superboard.com/input.cgi?db=75_comic114&action=write
http://free1.ttboard.com/docu21/ttboard/ttboard.cgi?act=write&category=&page=1&searchblock=1&bname=5&mode=re&code=
http://mic.cnu.ac.kr/~econ/nboard/board.cgi?id=trade5&page=&action=input_form
http://www.ilpro.co.kr/newilpro/board/write.asp?tablename=freetalk
http://www.inbex2001.com/write.asp?tbl=free
http://www.kordaq.co.kr/guide/board/write.php3?im=4&db=cdata&pg=1
http://www.greentax.co.kr/board/write.asp
http://humantemp.co.kr/medical/write.asp
http://www.golra.net/job/write.asp?net=01
http://dmbi.nsu.ac.kr/board/pds2/write.php?board=pds2&page=0&query=&kind=
http://www.ibckorea.co.kr/way-board/way-board.cgi?db=qna&j=tm&no=387&pg=1
http://www.k2k.co.kr/board/cafe/write.asp?sql=
http://comictoto.com/cgi-bin/way-board/way-board.cgi?db=free&j=w&pg=1
http://www.thcbic.ac.kr/board_new/list.php?writermod=writer
http://www.meatline21.com/bbs/bbs.cgi?db=board2&mode=write&backdepth=1
http://xbbs.yescall.com/modi_f.php?tbl=beerclubtz&tm=default
http://www.food119.co.kr/sub5/menu_1/f2000/write.asp
http://service.wowkorea.net/hostingboard/board.php3?bbs=eckorea1&mode=write
http://board4.interpia98.net/cgi-bin/Board/board.cgi?db=startok&mode=write&backdepth=1
http://bbs.boramventure.co.kr/cgi/main.cgi?board=cyber_consultin&command=write_form
http://turtle.new21.org/spboard/board.cgi?id=pnews&page=&action=input_form
http://cgi.whois.co.kr/cgi-bin/bbs/bbs.cgi?db=imgm&mode=write&backdepth=1
http://www.maniapcbang.com/webboard/webboard.cgi?db=mania02&mode=write&backdepth=1
http://www.ohmybiz.co.kr/sarangbang/sarangbang01/write.asp
http://www.interior119.net/board/write.asp?id=fr
http://www.thanksjob.co.kr/cgi-bin/kimsboard/kimsboard.cgi?db=bod_11&action=write
http://jibic.good22.co.kr/info/changupwrite.asp
http://www.changupe.com/qna/sell_write.php?kind=1
http://www.pncg.co.kr/board/write.asp
http://www.ok-chicken.co.kr/sisic/write.asp
http://www.ksbm.org/board/board.htm?mode=write&db=bbs
http://www.sweetbuns.co.kr/board_1/write1.asp?board=y_board
http://www.minisaup.com/free/write.php
http://www.chainopen.com/board01/write.html?write_type=new&start=0
http://hanseong.net/plus/board.php3?table=qa&query=write&p=1
http://ibic.iae.re.kr/spboard/board.cgi?id=ibic&action=input_form&page=
http://www.miraelotto.co.kr/board.php3?table=qa&query=write&p=1
http://user1.personaldb.net/board/board_write1.asp?serverno=1&owner=madangbal&boardno=8&bgcolor=
http://beertogo.co.kr/dasoolcgi/main.cgi?board=free&command=guest_email&textnum=1020868005
http://www.kitvc.co.kr/dbo/board/write.asp
http://www.cbikorea.com/menu5_know/form_write_scr.asp?isnew=new&kw_code1=d1
http://www.miraesolution.co.kr/board/new.php?db=miraesolution
http://bioventure.chonbuk.kr/board/write.asp?page=1
http://www.hangarifranchise.co.kr/desk/postform.php?code=board1
http://www.ttsconsulting.co.kr/board/board_new.html?code=tts_cyber
http://ihanulim.co.kr/member/main.cgi?board=cook_01&command=write_form
http://www.beerinfo.co.kr/board/main.php?code=sales_info&mode=write&pnum=1
http://docean.net/~bigsmile/php/zboard40/write.php?id=qa&page=1&category=&sn=off&ss=on&sc=on&keyword=&select_arrange=headnum&desc=asc&no=&mode=write
http://www.icba.or.kr/icba_board/board_form.asp?tbl=board&cpage=1

   <<Less

Re: I have a big problem about post data to any form(any server). (by java application).

Posted By:   guru_prasanth  
Posted On:   Tuesday, May 14, 2002 01:37 AM

u will not be able to post to any form directly from java application but u can pass data to servlets from application using post.for that u need to control the server
ie your sevlets has to reside on server.
About | Sitemap | Contact