Alert: Reading stdIn from POST in CGI's

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Alert: Reading stdIn from POST in CGI's

Sivakatirswami
just and FYI alert: I'm pretty sure I have confirmed an old bug (once  
again) in revolution CGI  read stnIn from a POST returns empty.  
Newbies could get easily burned on this one if they didn't see this  
discussion recently.

Be sure to *always* use the form.

on startup

if $REQUEST_METHOD is "POST" then

     put "" into PostIn
     repeat until length(PostIn) >= $CONTENT_LENGTH
         read from stdin until ""
             put it after PostIn
       end repeat
     put  urlDecode (PostIn)  into tDataIn

     split tDataIn by "&" and "="
     put keys(tDataIn) into tFields

# where you use the $CONTENT_LENGTH to force reads on a repeat loop.

The following

on startup
if $REQUEST_METHOD is "POST" then
    read from stdin until empty
    put  urlDecode (it)  into tDataIn
    split tDataIn by "&" and "="

is guaranteed to fail, but only intermittently.  Symptom... no data  
at all passed to variable "it", even on a post with a trivial amt of  
data (name address, ph# and CC#). It does not seem to have anythng to  
do at all with

a) traffic
b) concurrent hits
c) amt of data posted

i.e. even a simple 3 name-value pair set:

name=katir
ph=822-7032
comment=test

can be posted and the read from stdIn fails. try again.. it works...  
try again, it works, try again, it fails...

Sivakatirswami




_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: Alert: Reading stdIn from POST in CGI's

Thomas McCarthy

Sivakatirswami, Thanks for the enlightenment. I'm just starting to work with cgi and I can see that this heads up will save me a lot of headaches. Thanks
tom

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution