Re: POST variables to CGI via URL with URLencoded string fails??
On Friday, October 17, 2003, at 09:40 PM, Dave Cragg wrote: OK, that works great... can we depend on the order of the environment variables? i.e This works: put urlDecode (value(item 3 of the globals)) into tRemit and delivers the $QUERY_STRING value.. but if the order changed the cgi would break (depends on $QUERY_STRING being always item three of the globals) I don't understand why the order is important. Why can't you do this? put urlDecode($QUERY_STRING) into tRemit Well, if you can, great... right, you are, order is not important... sheer ignorance on my part about the fundamentals of http processing. I tend to "run on examples" and assumed that one needed to get all the globals into a variable before one could address any particular one of them. I didn't know about the $ sign... (I see the documentation now in the transcript dictionary...) mmm, one of these days I should just sit down and read the entire printed manual (I did that years ago for Supercard's 1000 page manual, but haven't for Rev...) Thanks Dave, for being there! Sivakatirswami "Who you are makes a difference." ;-) Cheers Dave ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: POST variables to CGI via URL with URLencoded string fails??
At 2:24 pm -1000 17/10/03, Sannyasin Sivakatirswami wrote: OK, that works great... can we depend on the order of the environment variables? i.e This works: put urlDecode (value(item 3 of the globals)) into tRemit and delivers the $QUERY_STRING value.. but if the order changed the cgi would break (depends on $QUERY_STRING being always item three of the globals) I don't understand why the order is important. Why can't you do this? put urlDecode($QUERY_STRING) into tRemit Cheers Dave ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: POST variables to CGI via URL with URLencoded string fails??
Aloha from Hawaii, "wonderful Dave!" OK, that works great... can we depend on the order of the environment variables? i.e This works: put urlDecode (value(item 3 of the globals)) into tRemit and delivers the $QUERY_STRING value.. but if the order changed the cgi would break (depends on $QUERY_STRING being always item three of the globals) This also works and would not be affected by a change of order repeat for each item i in the globals put i & "=" & value(i) & cr after tGlobes end repeat split tGlobes by cr and "=" put urlDecode (tGlobes["$QUERY_STRING"]) into tDataIn What is recommended? Thanks, what a great list, solutions in under 18 hours ;-) Sivakatirswami On Thursday, October 16, 2003, at 11:03 PM, Dave Cragg wrote: In this case you should be using GET not POST. On the server side, your script shouldn't be reading from the socket; that will only get posted data, and in this case there is none. Instead, it should be getting the $QUERY_STRING environment variable which should contain this: name=Aloha+test&email=jiva%40hindu.org Cheers Dave ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: POST variables to CGI via URL with URLencoded string fails??
At 2:07 pm -1000 16/10/03, Sannyasin Sivakatirswami wrote: I have a simple CGI running that receives subscription requests to our Hindu Press International mailing list. Odd thing is... if I post the name and email address (only two fields in this form) to the CGI from a web form.. it works.. but if we try to post the same two values via a standard URL, with the input values appended in the normal way a URLencoded string, the CGI does respond, but it tells us that standardIn is returning empty?? The beginning of the CGI is straightforward: on startup read from stdin until empty put it into temp put urlDecode (it) into tDataIn put tDataIn into tRemit split tDataIn by "&" and "=" put isWellFormedMailtoScheme (tDataIn ["email"]) into emailCheck switch emailCheck ## etc. process the subscription.. only two values expected, name and email address... But this: http://www.hinduismtoday.com/cgi-bin/ send_sub_request.cgi?name=Aloha+test&email=jiva%40hindu.org doesn't work... standardIn returns empty. In this case you should be using GET not POST. On the server side, your script shouldn't be reading from the socket; that will only get posted data, and in this case there is none. Instead, it should be getting the $QUERY_STRING environment variable which should contain this: name=Aloha+test&email=jiva%40hindu.org Cheers Dave ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: POST variables to CGI via URL with URLencoded string fails??
could it be the space in the filename? (after /cgi-bin/) But this: http://www.hinduismtoday.com/cgi-bin/ send_sub_request.cgi?name=Aloha+test&email=jiva%40hindu.org doesn't work... standardIn returns empty. but this online service for auto generating posts to CGI's does work: http://www.io.com/~jsm/nph-ap.cgi/http://www.hinduismtoday.com/cgi-bin/ send_sub_request.cgi?name=Aloha+test&email=jiva%40hindu.org Any clues on why standardIn would be empty on one and not on the other? Or strategies for testing? Thanks Sannyasin Sivakatirswami ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
POST variables to CGI via URL with URLencoded string fails??
I have a simple CGI running that receives subscription requests to our Hindu Press International mailing list. Odd thing is... if I post the name and email address (only two fields in this form) to the CGI from a web form.. it works.. but if we try to post the same two values via a standard URL, with the input values appended in the normal way a URLencoded string, the CGI does respond, but it tells us that standardIn is returning empty?? The beginning of the CGI is straightforward: on startup read from stdin until empty put it into temp put urlDecode (it) into tDataIn put tDataIn into tRemit split tDataIn by "&" and "=" put isWellFormedMailtoScheme (tDataIn ["email"]) into emailCheck switch emailCheck ## etc. process the subscription.. only two values expected, name and email address... But this: http://www.hinduismtoday.com/cgi-bin/ send_sub_request.cgi?name=Aloha+test&email=jiva%40hindu.org doesn't work... standardIn returns empty. but this online service for auto generating posts to CGI's does work: http://www.io.com/~jsm/nph-ap.cgi/http://www.hinduismtoday.com/cgi-bin/ send_sub_request.cgi?name=Aloha+test&email=jiva%40hindu.org Any clues on why standardIn would be empty on one and not on the other? Or strategies for testing? Thanks Sannyasin Sivakatirswami Himalayan Academy Publications at Kauai's Hindu Monastery [EMAIL PROTECTED] www.HimalayanAcademy.com, www.HinduismToday.com www.Gurudeva.org www.Hindu.org ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution