post method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • panayiotis periorellis

    post method

    Hello All,

    Im trying to pass some parameters to a CGI script from Java. I know how to
    pass simple parameters but im having trouble passing the radio button. Could
    someone please have a look at the following form and let me know how the
    radio button parameter and its value can be passed from a java program?
    thanks in advance
    P

    form METHOD="POST" ACTION="/cgi-bin/nbrfget">
    <input TYPE="radio" NAME="fmt" VALUE="C" CHECKED>CODATA, &nbsp;
    <input TYPE="radio" NAME="fmt" VALUE="H">CODAT A/HTML,&nbsp;
    <input TYPE="radio" NAME="fmt" VALUE="N">NBRF,
    <input TYPE="radio" NAME="fmt" VALUE="F">FASTA
    <input TYPE="radio" NAME="fmt" VALUE="X">XML.</DT>
    <DT><b>Type of identifier:</b
    <select NAME="xref">
    <option VALUE="0">PIR Unique ID
    <option VALUE="1">PIR Accession
    <option VALUE="2">PIR Reference Number
    </select>
    <input TYPE="text" NAME="id" SIZE=30>
    <input TYPE="submit" VALUE="Submit"> &nbsp; &nbsp;<input TYPE="reset"
    VALUE="Clear">
    </DL>
    </form>

    and here is some of the java code...i 'm looking to POST the parameters of
    the above form to this

    String cgiscript ="http://pir.georgetown. edu/cgi-bin/nbrfget";

    try
    {
    URL url = new URL(cgiscript);
    URLConnection connection =url.openConnec tion();
    connection.setD oInput( true );
    connection.setD oOutput( true );

    }
    catch( Exception e ) {}


Working...