Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PSP / mod_python ... how to get POST vars on .psp ?

Reply
Thread Tools

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

 
 
Rod Castellanos
Guest
Posts: n/a
 
      06-07-2005
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.
 
Reply With Quote
 
 
 
 
poisondart
Guest
Posts: n/a
 
      06-07-2005
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

 
Reply With Quote
 
 
 
 
Steve Holden
Guest
Posts: n/a
 
      06-07-2005
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
PSP News. Working PSP Firmware 2.0 to 1.50 Downgrader!!! XP NZ Computing 0 09-28-2005 09:01 AM
PSP / mod_python ... how to get POST vars on .psp ? Rod Castellanos Python 1 06-07-2005 03:27 AM
Hey, Free Sony PSP. Best thing since sliced bread! It's So easy,and 100% legal! GET A FREE SONY PSP! !!NO CATCH!! Sarah Stewart Computer Support 0 05-08-2005 08:47 AM
app vars and cache vars Jon ASP .Net 3 12-14-2004 08:52 PM



Advertisments