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

  • Thread starter Rod Castellanos
  • Start date
R

Rod Castellanos

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.
 
S

Steve Holden

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top