PSP / mod_python ... how to get POST vars on .psp ?

Discussion in 'Python' started by Rod Castellanos, Jun 7, 2005.

  1. Ive been looking everywhere, I need to get a var in my .psp file from
    another one,
    I managed to send it with a form and I can read it with "req.read" but
    it reads all of the variables together separated by a "&" like all
    POST/GET vars.

    How do I store each one in a python var, Im looking for something like
    $_POST and $_GET from php.

    Thanx.
    Rod Castellanos, Jun 7, 2005
    #1
    1. Advertising

  2. Rod Castellanos

    poisondart Guest

    poisondart, Jun 7, 2005
    #2
    1. Advertising

  3. Rod Castellanos

    Steve Holden Guest

    poisondart wrote [without quoting the question]:
    > Would something like cgi.FieldStorage() be what you're looking for?
    >
    > form = cgi.FieldStorage()
    >
    > form[ <name of variable here> ] = <value of variable>
    >
    > http://www.python.org/doc/2.3.5/lib/node406.html
    >

    The problem with that would be that cgi.FieldStorage [checks manual ...]
    reads standard input, while mod_python appears to make the input
    available through the request's read() method. So you would need to
    temporarily replace the process's standard input with the request object.

    I don't guarantee that would *work*, mind. It would just be a bit less
    wrong :)

    regards
    Steve
    --
    Steve Holden +1 703 861 4237 +1 800 494 3119
    Holden Web LLC http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Steve Holden, Jun 7, 2005
    #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. Rod Castellanos
    Replies:
    1
    Views:
    438
  2. Replies:
    1
    Views:
    452
  3. exhuma.twn
    Replies:
    3
    Views:
    326
    exhuma.twn
    Mar 20, 2006
  4. exhuma.twn
    Replies:
    2
    Views:
    519
    exhuma.twn
    Mar 20, 2006
  5. cloc3
    Replies:
    2
    Views:
    324
    cloc3
    Jun 12, 2006
Loading...

Share This Page