Passing a String to a Python CGI Script

Discussion in 'Python' started by DeepBleu, Sep 23, 2003.

  1. DeepBleu

    DeepBleu Guest

    When one is using an HTML form via a web broswer, the user submits the form
    contents and these are passed to a CGI Python script on the web server.
    I need to write a client script that connects to a web site, runs a Python
    CGI script on the web server AND passes a string to the CGI Python script
    that the Python CGI script can store/manipulate/evalute etc....
    I know how to connect to the web site and run the CGI Python script using a
    client Python script with the urllib module. But how do I submit/send a
    string via this client Python script to the web server on behalf of the CGI
    Python script? Can someone give me a clue or a hint on how to do that? Do
    I write the string to the web server? If so, how would the CGI Python
    script know about it, read it, and store it?
    Thanks,
    DeepBleu
     
    DeepBleu, Sep 23, 2003
    #1
    1. Advertising

  2. DeepBleu

    DeepBleu Guest

    I'll reword that:
    A client is writing a string to the web server (IPlanet on a Sun Server)
    using a java program. The client then establishes a connection with a cgi
    Python program on the server. This client wants the string to be passed
    into this cgi Python script on the server.
    There are no name=value request pairs. How can this cgi Python script read
    the string sent to the web server. The client is POSTING the string as a
    REQUEST. For the Pythong cgi script I am using CGI module to handle
    requests and responses. However, how do you handle this REQUEST?

    "DeepBleu" <> wrote in message
    news:AY3cb.104524$...
    > When one is using an HTML form via a web broswer, the user submits the

    form
    > contents and these are passed to a CGI Python script on the web server.
    > I need to write a client script that connects to a web site, runs a Python
    > CGI script on the web server AND passes a string to the CGI Python script
    > that the Python CGI script can store/manipulate/evalute etc....
    > I know how to connect to the web site and run the CGI Python script using

    a
    > client Python script with the urllib module. But how do I submit/send a
    > string via this client Python script to the web server on behalf of the

    CGI
    > Python script? Can someone give me a clue or a hint on how to do that?

    Do
    > I write the string to the web server? If so, how would the CGI Python
    > script know about it, read it, and store it?
    > Thanks,
    > DeepBleu
    >
    >
     
    DeepBleu, Sep 26, 2003
    #2
    1. Advertising

  3. DeepBleu

    DeepBleu Guest

    I figured this thing out. But, really truly no one could have suggested the
    use of standard I/O????
    DeepBleu

    "DeepBleu" <> wrote in message
    news:METcb.113316$...
    > I'll reword that:
    > A client is writing a string to the web server (IPlanet on a Sun Server)
    > using a java program. The client then establishes a connection with a cgi
    > Python program on the server. This client wants the string to be passed
    > into this cgi Python script on the server.
    > There are no name=value request pairs. How can this cgi Python script

    read
    > the string sent to the web server. The client is POSTING the string as a
    > REQUEST. For the Pythong cgi script I am using CGI module to handle
    > requests and responses. However, how do you handle this REQUEST?
    >
    > "DeepBleu" <> wrote in message
    > news:AY3cb.104524$...
    > > When one is using an HTML form via a web broswer, the user submits the

    > form
    > > contents and these are passed to a CGI Python script on the web server.
    > > I need to write a client script that connects to a web site, runs a

    Python
    > > CGI script on the web server AND passes a string to the CGI Python

    script
    > > that the Python CGI script can store/manipulate/evalute etc....
    > > I know how to connect to the web site and run the CGI Python script

    using
    > a
    > > client Python script with the urllib module. But how do I submit/send a
    > > string via this client Python script to the web server on behalf of the

    > CGI
    > > Python script? Can someone give me a clue or a hint on how to do that?

    > Do
    > > I write the string to the web server? If so, how would the CGI Python
    > > script know about it, read it, and store it?
    > > Thanks,
    > > DeepBleu
    > >
    > >

    >
    >
     
    DeepBleu, Sep 26, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. praba kar

    Python-cgi or Perl-cgi script doubt

    praba kar, Jul 30, 2005, in forum: Python
    Replies:
    1
    Views:
    748
    Michael Sparks
    Jul 30, 2005
  2. Amir  Michail

    cgi relay for python cgi script

    Amir Michail, Oct 4, 2005, in forum: Python
    Replies:
    7
    Views:
    465
    Michael Ekstrand
    Oct 4, 2005
  3. kath
    Replies:
    4
    Views:
    740
    J. Gleixner
    Apr 9, 2007
  4. ashish
    Replies:
    4
    Views:
    305
    ashish
    Sep 20, 2012
  5. ashish
    Replies:
    5
    Views:
    541
    Piet van Oostrum
    Sep 20, 2012
Loading...

Share This Page