Problem is this. I POST a form to a page called process_html. Inside process I do some validation on posted variables. If i find that something is wrong I want to complain by sending the user to bad_input_html?errmsg=Username%20Empty (which is a GET request in theory). What happens is that the redirect is a mix of GET and POST. It is a pure POST request, but the querystring is picked up as well. Truth is that this works fine in Internet Explorer, but it fails on the UK Vodafone WAP Gateway. It works on all other WAP Gateways except this one. This tag would work in a normal situation: <form action="process_html?loginname=Peter%20Bengtsson" method=POST> But with my gateway only the POST variables are sent and the variable "loginname" is ignored. Anyhow. How do I "leave" the POST requesting and break out of it to do a GET request?? Is there a header I can set? <pseudo code> <dtml-call "RESPONSE.setHeader('REQUEST_METHOD: GET')"> </pseudo code> Any smart suggestions more than welcome! Peter
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Peter Bengtsson
How do I "leave" the POST requesting and break out of it to do a GET request?? Is there a header I can set? <pseudo code> <dtml-call "RESPONSE.setHeader('REQUEST_METHOD: GET')"> </pseudo code>
I know that on the IIS there is:: Request('varname') // if you don't care about getting data from post or get and Request.Form('varname') // Data from Post and Request.QuerysString('varname') // data from get But I just tried browsing the source for Zope's request module, and I can't see any way to specify how to get data from post or get explicitly. sorry
This tag would work in a normal situation: <form action="process_html?loginname=Peter%20Bengtsson" method=POST> But with my gateway only the POST variables are sent and the variable "loginname" is ignored.
Perhaps you should rethink your approach and send you data in a form? <form action="process_html" method=POST> <input type=hidden name=loginname value=Peter%20Bengtsson> Regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
Couldn't you just put them into the Post as hidden form fields, or am I missing the point again? <input type="hidden" name="errmsg" value="Username Empty"> for example. On Monday 05 March 2001 9:19 pm, Peter Bengtsson wrote:
Problem is this. I POST a form to a page called process_html.
Inside process I do some validation on posted variables. If i find that something is wrong I want to complain by sending the user to bad_input_html?errmsg=Username%20Empty (which is a GET request in theory). What happens is that the redirect is a mix of GET and POST. It is a pure POST request, but the querystring is picked up as well.
Truth is that this works fine in Internet Explorer, but it fails on the UK Vodafone WAP Gateway. It works on all other WAP Gateways except this one. This tag would work in a normal situation: <form action="process_html?loginname=Peter%20Bengtsson" method=POST> But with my gateway only the POST variables are sent and the variable "loginname" is ignored.
Anyhow. How do I "leave" the POST requesting and break out of it to do a GET request?? Is there a header I can set? <pseudo code> <dtml-call "RESPONSE.setHeader('REQUEST_METHOD: GET')"> </pseudo code>
Any smart suggestions more than welcome!
Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
You are missing the point I'm afraid. I'm processing POSTed variables and all of a sudden I decide that I want to GET somewhere else using a RESPONSE.redirect(sompage?cgi=querystring) statement. Do the RESPONSE.redirect whilst processing the POST data causes the RESPONSE.redirect to act a POST. This is clear if I look at the Z2.log which shows something like this: "POST /somepage?cgi=querystring HTTP/1.1" If I skip that redirect thing and replace it with a ugly hyperlink the request is stored in the log lik this: "GET /somepage?cgi=querystring HTTP/1.1" See the difference and the problem? I want my RESPONSE.redirect to act like a GET request like a hyperlink does. Peter
Couldn't you just put them into the Post as hidden form fields, or am I missing the point again?
<input type="hidden" name="errmsg" value="Username Empty">
for example.
On Monday 05 March 2001 9:19 pm, Peter Bengtsson wrote:
Problem is this. I POST a form to a page called process_html.
Inside process I do some validation on posted variables. If i find that something is wrong I want to complain by sending the user to bad_input_html?errmsg=Username%20Empty (which is a GET request in theory). What happens is that the redirect is a mix of GET and POST. It is a pure POST request, but the querystring is picked up as well.
Truth is that this works fine in Internet Explorer, but it fails on the UK Vodafone WAP Gateway. It works on all other WAP Gateways except this one. This tag would work in a normal situation: <form action="process_html?loginname=Peter%20Bengtsson" method=POST> But with my gateway only the POST variables are sent and the variable "loginname" is ignored.
Anyhow. How do I "leave" the POST requesting and break out of it to do a GET request?? Is there a header I can set? <pseudo code> <dtml-call "RESPONSE.setHeader('REQUEST_METHOD: GET')"> </pseudo code>
Any smart suggestions more than welcome!
Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Monday 05 March 2001 18:09, Peter Bengtsson wrote:
You are missing the point I'm afraid. I'm processing POSTed variables and all of a sudden I decide that I want to GET somewhere else using a RESPONSE.redirect(sompage?cgi=querystring) statement. Do the RESPONSE.redirect whilst processing the POST data causes the RESPONSE.redirect to act a POST. This is clear if I look at the Z2.log which shows something like this: "POST /somepage?cgi=querystring HTTP/1.1"
If I skip that redirect thing and replace it with a ugly hyperlink the request is stored in the log lik this: "GET /somepage?cgi=querystring HTTP/1.1"
See the difference and the problem? I want my RESPONSE.redirect to act like a GET request like a hyperlink does.
Peter
you could try out the dtml-contract tag i just released. the default behavior if a user asks for a dtml method (say foo) and their input is bad is to use whatever error handler you specify (say bar). but it won't redirect them to it, it will write straight to the connection the rendering of bar (having added the error messages to the namespace). to the client it looks like a request for http://www.domain.com/foo (with POST) still. hth kapil thangavelu
[joining the thread late, sorry if this is worthless] You could have the response to the POST be a page that sends back a page with the meta...refresh tag, where the new url to go to is the url with all the form fields encoded into it. HTH, jim
It must be markup-less. Exactly the same code is used to WML and HTML in my case. P ----- Original Message ----- From: "Jim Hebert" <jim@cosource.com> To: <zope@zope.org> Sent: Tuesday, March 06, 2001 2:59 AM Subject: Re: [Zope] From POST to GET
[joining the thread late, sorry if this is worthless]
You could have the response to the POST be a page that sends back a page with the meta...refresh tag, where the new url to go to is the url with all the form fields encoded into it.
HTH, jim
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Peter, Peter Bengtsson wrote:
You are missing the point I'm afraid. I'm processing POSTed variables and all of a sudden I decide that I want to GET somewhere else using a RESPONSE.redirect(sompage?cgi=querystring) statement. Do the RESPONSE.redirect whilst processing the POST data causes the RESPONSE.redirect to act a POST. This is clear if I look at the Z2.log which shows something like this: "POST /somepage?cgi=querystring HTTP/1.1"
If I skip that redirect thing and replace it with a ugly hyperlink the request is stored in the log lik this: "GET /somepage?cgi=querystring HTTP/1.1"
See the difference and the problem? I want my RESPONSE.redirect to act like a GET request like a hyperlink does.
There should be no problem wether it is actually a POST or a GET request. The redirected page should be addressed by the useragent with GET. However, Zope at least parses both the arguments in the query-string and the ones in the entidy-body, as it is with POST requests. Please note, redirects have to include the fully hostname. E.g. http://somesite/somepage Regards Tino
No Tino. I must unfortunatly prove you wrong on that. Is it necessarily the ZServer doing that magic? My WAP site was working fine in webbrowsers and a few other WAP Gateways until I started using UK Vodafone WAP Gateway. What happened was that I ended up at a page with this URL page?var=value but using <dtml-var REQUEST> the var variable was not at all available. ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Peter Bengtsson" <peter@grenna.net> Cc: "Phil Harris" <phil.harris@zweb.co.uk>; <zope@zope.org> Sent: Tuesday, March 06, 2001 3:58 PM Subject: Re: [Zope] From POST to GET
Hi Peter,
Peter Bengtsson wrote:
You are missing the point I'm afraid. I'm processing POSTed variables and all of a sudden I decide that I want
to
GET somewhere else using a RESPONSE.redirect(sompage?cgi=querystring) statement. Do the RESPONSE.redirect whilst processing the POST data causes the RESPONSE.redirect to act a POST. This is clear if I look at the Z2.log which shows something like this: "POST /somepage?cgi=querystring HTTP/1.1"
If I skip that redirect thing and replace it with a ugly hyperlink the request is stored in the log lik this: "GET /somepage?cgi=querystring HTTP/1.1"
See the difference and the problem? I want my RESPONSE.redirect to act like a GET request like a hyperlink does.
There should be no problem wether it is actually a POST or a GET request. The redirected page should be addressed by the useragent with GET. However, Zope at least parses both the arguments in the query-string and the ones in the entidy-body, as it is with POST requests.
Please note, redirects have to include the fully hostname. E.g. http://somesite/somepage
Regards Tino
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (6)
-
ender -
Jim Hebert -
Max M -
Peter Bengtsson -
Phil Harris -
Tino Wildenhain