[AOLSERVER] Form Posting
I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com
Re: [AOLSERVER] Form Posting
Funny you should mention that. I'm adding the ns_httpspost command to https.tcl this weekend. I'll also be adding the ns_httppost to http.tcl. /s. I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com
Re: [AOLSERVER] Form Posting
Where do you want the output of the POST request to go? A) Back to your tcl script or B) direct to the user's browser? Where do you want to make this POST request to? C) To any arbitrary webserver or D) to your webserver only? A) C) = use util_httppost from the OpenACS toolkit B) C) = screwed (or use util_httppost and then send that output back yourself) D) = use Rob Mayoff's internal redirection module (www.dqd.com) Jerry At 10:07 AM 8/23/01, you wrote: I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com = Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161Tel: (510) 549-2980 Berkeley, CA 94709Fax: (877) 311-8688
Re: [AOLSERVER] Form Posting
I want to be able to redirect the user to another url on my site, and send information to the tcl script residing at that url (register_proc) using form data.. without the URL including the content of what I am sending.. so I can then operate on that sent data without it being painfully clear what that data is to the average joe user... I don't want to use a database and store temporary data and refer back to that... it would make it more complex and add to the database usage in areas that don't need more of it... I'll grab the latest OpenACS stuff and take a look at that as well as Scotts stuff when he releases his next round :) Thank you.. :) -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com - Original Message - From: Jerry Asher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 10:52 AM Subject: Re: [AOLSERVER] Form Posting Where do you want the output of the POST request to go? A) Back to your tcl script or B) direct to the user's browser? Where do you want to make this POST request to? C) To any arbitrary webserver or D) to your webserver only? A) C) = use util_httppost from the OpenACS toolkit B) C) = screwed (or use util_httppost and then send that output back yourself) D) = use Rob Mayoff's internal redirection module (www.dqd.com) Jerry At 10:07 AM 8/23/01, you wrote: I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com = Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161Tel: (510) 549-2980 Berkeley, CA 94709Fax: (877) 311-8688
Re: [AOLSERVER] Form Posting
From what I understand cookies won't set if you do a redirect... this is part of what I want the capacity for.. -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com - Original Message - From: Mark Hubbard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 11:17 AM Subject: Re: [AOLSERVER] Form Posting You could also try setting a cookie containing the information before (or maybe during) the redirect. That way you wouldn't need a form submission. Assuming the client accepts cookies. -- Mark Hubbard: [EMAIL PROTECTED] Microsoft Certified Professional Knowledge is Power. -Original Message- From: Patrick Spence [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, August 23, 2001 1:01 PM Subject: Re: Form Posting I want to be able to redirect the user to another url on my site, and send information to the tcl script residing at that url (register_proc) using form data.. without the URL including the content of what I am sending.. so I can then operate on that sent data without it being painfully clear what that data is to the average joe user... I don't want to use a database and store temporary data and refer back to that... it would make it more complex and add to the database usage in areas that don't need more of it... I'll grab the latest OpenACS stuff and take a look at that as well as Scotts stuff when he releases his next round :) Thank you.. :) -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com - Original Message - From: Jerry Asher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 10:52 AM Subject: Re: [AOLSERVER] Form Posting Where do you want the output of the POST request to go? A) Back to your tcl script or B) direct to the user's browser? Where do you want to make this POST request to? C) To any arbitrary webserver or D) to your webserver only? A) C) = use util_httppost from the OpenACS toolkit B) C) = screwed (or use util_httppost and then send that output back yourself) D) = use Rob Mayoff's internal redirection module (www.dqd.com) Jerry At 10:07 AM 8/23/01, you wrote: I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com = Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161Tel: (510) 549-2980 Berkeley, CA 94709Fax: (877) 311-8688
Re: [AOLSERVER] Form Posting
You mean, like this: form method=post input type=hidden name=msg1 value=hello input type=hidden name=msg2 value=bye input type=submit value=Go /form ? -- Dossy On 2001.08.23, Patrick Spence [EMAIL PROTECTED] wrote: I am looking for some easy way (i.e. a tcl routine not a C routine or module) to post form data into a URL without passing it on the URL line itself... instead of redirecting to say http://www.foo.com/bar?msg1=hellomsg2=bye I would like to do something like this: add_form_value storagevariable msg1 hello add_form_value storagevariable msg2 bye post_form http://www.foo.com/bar; $storagevariable and have it redirect to the url and post the data the same as if a user had filled out a form and hit submit instead of the URL based method.. Does anyone know how to do this? Any help would be appreciated -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com -- Dossy Shiobara mail: [EMAIL PROTECTED] Panoptic Computer Network web: http://www.panoptic.com/
Re: [AOLSERVER] Form Posting
You might also try actually passing the data in the URL, like you didn't want to do, but scramble it up first. There are any number of good ways to do that, either with TCL native, or by calling C. -- Mark Hubbard: [EMAIL PROTECTED] Microsoft Certified Professional Knowledge is Power. -Original Message- From: Patrick Spence [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, August 23, 2001 3:00 PM Subject: Re: Form Posting Part of what I am trying to work around is cookies not setting on a redirect... as one part of what I am doing is where I am authenticating the user and setting a sessionid cookie as part of my user tracking and security... if I use a standard redirect the cookie vapors... right now I am following the path of setting a url with the username as a variable (part of what I would like to pass as a form post to keep hidden), and redirecting the user to a new page that pulls that username from the form data and uses it to build part of the session cookie.. that page then uses a meta-refresh to redirect to the users page. The users page (and all pages past that point) check to see if a sessioncookie is set and that its coming from a valid referrer.. if either condition is not true it redirects them back out to the login page. A bit of a kludge fix, but without the capacity to set a cookie then do a ns_returnredirect (which I have been assured by my code-guru and my brief testing doesn't work) this is what I came up with to track things.. -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com - Original Message - From: Jerry Asher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 11:11 AM Subject: Re: [AOLSERVER] Form Posting At 11:02 AM 8/23/01, you wrote: I want to be able to redirect the user to another url on my site, and send information to the tcl script residing at that url (register_proc) using form data.. without the URL including the content of what I am sending.. so I can then operate on that sent data without it being painfully clear what that data is to the average joe user... I don't want to use a database and store temporary data and refer back to that... it would make it more complex and add to the database usage in areas that don't need more of it... Try Rob's internal redirect utility, which as he says provides a tcl wrapper for ns_connredirect. The effect is basically a goto or overlay. One moment you are running one script, then you internally redirect, and you start running your other script. What's most fun is that all your tcl variables are still there with the same values. So you need not post at all. I've used this for exactly the purpose you've given. rob's utilities: http://www.dqd.com/~mayoff/aolserver/#dqd_utils ns_connredirect doc: http://www.aolserver.com/docs/cdev/c-ch90.htm#576649 Jerry = Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161Tel: (510) 549-2980 Berkeley, CA 94709Fax: (877) 311-8688
Re: [AOLSERVER] Form Posting
patrick, there are a couple gotchas along the way; i'll call out as many as i can think of, and that might get you a good way towards where you want to be. 1. what you describe is exactly what we're doing, in a filter, to ensure a sessionId on every request. 2. setting a cookie really means adding a set-cookie header to the outputheaders, the value of which is name=value; [path|expires|domain=...] this odesn't get sent to the browser until a response is made- so it won't be in the request headers until the browser's next request. 2a.a. if the page where the cookie is set and the redirected location are in different directory paths, you'll want to set the path attribute to something standard- we use /, since the only cookie we're using is sesionId- things other than that are set using an nsv which is looked up based upon the sessionId cookie. also, if you want to store the cookie on the users' disks, you'll have to set the expires to something in the future. an unset expires means only in the browser session which really means until the user closes the browser. a favorite resource of mine is: http://home.netscape.com/newsref/std/cookie_spec.html 2a. this assumes that you include the aforementioned outputheaders in the request. note that ns_returnredirect doesn't allow for a -headers arguement. we instead use a wrapper around ns_respond, which isn't as bad as it first seems. 2b. there was a bug a while back i noted but never took the time to duplicate, about ns_conn outputheaders not working. it might be part of your problem. do a search of the archives for the string TCL_OUTHDRS or ns_conn outputheaders does not work and you'll probably hit the bug i'm talking about. i think in general you'll want to switch to using ns_respond and setting your own outputheaders, but ns_returnredirect should pass along the correct headers- i.e. including the ones you've set. folks, is this last assumption correct? -Original Message- From: Patrick Spence [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 1:02 PM To: [EMAIL PROTECTED] Subject: Re: [AOLSERVER] Form Posting Part of what I am trying to work around is cookies not setting on a redirect... as one part of what I am doing is where I am authenticating the user and setting a sessionid cookie as part of my user tracking and security... if I use a standard redirect the cookie vapors... right now I am following the path of setting a url with the username as a variable (part of what I would like to pass as a form post to keep hidden), and redirecting the user to a new page that pulls that username from the form data and uses it to build part of the session cookie.. that page then uses a meta-refresh to redirect to the users page. The users page (and all pages past that point) check to see if a sessioncookie is set and that its coming from a valid referrer.. if either condition is not true it redirects them back out to the login page. A bit of a kludge fix, but without the capacity to set a cookie then do a ns_returnredirect (which I have been assured by my code-guru and my brief testing doesn't work) this is what I came up with to track things.. -- Patrick Spence, Network Administrator Information System Dept. 2401 South 24th Street, Phoenix, AZ 85034 [EMAIL PROTECTED] - http://www.vitamist.com - Original Message - From: Jerry Asher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 11:11 AM Subject: Re: [AOLSERVER] Form Posting At 11:02 AM 8/23/01, you wrote: I want to be able to redirect the user to another url on my site, and send information to the tcl script residing at that url (register_proc) using form data.. without the URL including the content of what I am sending.. so I can then operate on that sent data without it being painfully clear what that data is to the average joe user... I don't want to use a database and store temporary data and refer back to that... it would make it more complex and add to the database usage in areas that don't need more of it... Try Rob's internal redirect utility, which as he says provides a tcl wrapper for ns_connredirect. The effect is basically a goto or overlay. One moment you are running one script, then you internally redirect, and you start running your other script. What's most fun is that all your tcl variables are still there with the same values. So you need not post at all. I've used this for exactly the purpose you've given. rob's utilities: http://www.dqd.com/~mayoff/aolserver/#dqd_utils ns_connredirect doc: http://www.aolserver.com/docs/cdev/c-ch90.htm#576649 Jerry = Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161Tel: (510) 549-2980 Berkeley, CA 94709Fax: (877) 311-8688
Re: [AOLSERVER] Form Posting
- Original Message - From: Scott Laplante [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 1:57 PM Subject: Re: [AOLSERVER] Form Posting 1. what you describe is exactly what we're doing, in a filter, to ensure a sessionId on every request. I am using a sessionid to keep people out who have not logged in via my main form.. 2. setting a cookie really means adding a set-cookie header to the outputheaders, the value of which is name=value; [path|expires|domain=...] this odesn't get sent to the browser until a response is made- so it won't be in the request headers until the browser's next request. I know :) I am using Daniel Stasinski's fantastic cookie library for AolServer (you can get it at www.scriptkitties.com in the projects section) 2a.a. if the page where the cookie is set and the redirected location are in different directory paths, you'll want to set the path attribute to something standard- we use /, since the only cookie we're using is Thats what I am using.. sesionId- things other than that are set using an nsv which is looked up based upon the sessionId cookie. also, if you want to store the cookie on the users' disks, you'll have to set the expires to something in the future. an unset expires means only in the browser session which really means until the user closes the browser. a favorite resource of mine is: Thats what I want for a session cookie, so I have it set to expire when browser is closed.. in some circumstances I even remove the content of the cookie and force them to log back in again http://home.netscape.com/newsref/std/cookie_spec.html I keep meaning to read that... :) 2a. this assumes that you include the aforementioned outputheaders in the request. note that ns_returnredirect doesn't allow for a -headers arguement. we instead use a wrapper around ns_respond, which isn't as bad as it first seems. heh, first I have looked at ns_respond... now I have to figure out how to handle headers.. :) 2b. there was a bug a while back i noted but never took the time to duplicate, about ns_conn outputheaders not working. it might be part of your problem. do a search of the archives for the string TCL_OUTHDRS or ns_conn outputheaders does not work and you'll probably hit the bug i'm talking about. might be.. i think in general you'll want to switch to using ns_respond and setting your own outputheaders, but ns_returnredirect should pass along the correct headers- i.e. including the ones you've set. it hasn't so far for me :) but I should have this all straightened out and finished this weekend (hope hope hope) then I can write up my trials and tribulations of getting the ccBill credit card charging system to work with Aolserver.. (I had to *shudder* call tcl scripts from perl scripts) folks, is this last assumption correct? -- Patrick Spence [EMAIL PROTECTED] Want weather reports delevered to your desktop? http://ww2.weatherbug.com/aff/default.asp?ZCode=z3345