Re: GET insread of POST: what would you do?

2009-09-14 Thread Claude Schneegans

 >>Create a required variable and use that to redirect them back to the 
form.

Redirect them back to the form was indeed what I intent to do.
However, testing CGI.REQUEST_METHOD NEQ "post" seems more logical.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326303
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: GET insread of POST: what would you do?

2009-09-14 Thread Claude Schneegans

 >>After processing the form, redirect the browser (302 redirect, 
cflocation) to the 'thank you, your form is submitted' page.

Good point, except many times, the input process is not finished.
There may be 4 or 5 steps of form to fill before I can say "thank you".
Not really simple to pass all parameters using CFLOCATION.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326302
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: GET insread of POST: what would you do?

2009-09-14 Thread Claude Schneegans

 >>request.data = url;
StructAppend(request.data, form);

This will work if the GET request transmits the form parameters in the 
url instead, but it is not the case: the url contains no value.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326301
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: GET insread of POST: what would you do?

2009-09-14 Thread Dominic Watson

It is common to treat post and get data in the same way; simply, user input.
I find doing this gives you greater flexibility and clarity (my page gets
input, I do stuff with it). All frameworks that I have used have done this
and it's a real snip to do at the beginning of a request somewhere:

request.data = url;
StructAppend(request.data, form);

Of course, request.data could be 'variables.userInput' or whatever seems
good to you.

Dominic

2009/9/14 Claude Schneegans 

>
> Hi,
>
>  From time to time, I find in my error log errors due to undefined form
> variables.
> The reason being that the template was requested using method GET
> instead of POST.
>
> Of course, there are dumb bots that would GET any address they find in a
> page,
> but there are also true visitors, even registered members, who will
> eventually cause the same error.
>
> I've also noticed that if you are in a page submitted from a FORM, you
> click on the address bar in the browser
> and press Enter, then the same page will be requested with a GET, and
> cause the same error.
>
> Then I intend to write some tag that will check the method used in the
> request,
> but my question is: what would you do - or already do -  in case of GET
> instead of POST?
> - send some error response?
> - send the user back to the correct empty form?
> - send some Javascript code to go back in the history?
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326290
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: GET insread of POST: what would you do?

2009-09-14 Thread Hugo Ahlenius

| I thought it was clear in my initial post that the form was indeed 
| submitted using POST.
| and of course I do validate the values received.
| The problem is when the user resubmits it from his browser using GET 
| (probably not even being aware of it).
| I can detect this situation, my question was "What would be the best 
| do in this eventuality"

After processing the form, redirect the browser (302 redirect, cflocation) to 
the 'thank you, your form is submitted' page. That way they will never have the 
URL of the action page in the browser address bar, and you will get less 
problems with people getting there through the browser history.

Cheers,
Hugo


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326284
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: GET insread of POST: what would you do?

2009-09-14 Thread DURETTE, STEVEN J (ATTASIAIT)

Create a required variable and use that to redirect them back to the
form.

I.E.







Steve

-Original Message-
From: Claude Schneegans [mailto:schneeg...@internetique.com] 
Sent: Monday, September 14, 2009 4:00 PM
To: cf-talk
Subject: Re: GET insread of POST: what would you do?


 >>One thing though, if the values are showing up in the url then your
form
itself must be using GET, otherwise they wouldn't show in the URL.

I thought it was clear in my initial post that the form was indeed 
submitted using POST.
and of course I do validate the values received.
The problem is when the user resubmits it from his browser using GET
(probably not even being aware of it).

I can detect this situation, my question was "What would be the best do 
in this eventuality"



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326282
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: GET insread of POST: what would you do?

2009-09-14 Thread Claude Schneegans

 >>One thing though, if the values are showing up in the url then your form
itself must be using GET, otherwise they wouldn't show in the URL.

I thought it was clear in my initial post that the form was indeed 
submitted using POST.
and of course I do validate the values received.
The problem is when the user resubmits it from his browser using GET
(probably not even being aware of it).

I can detect this situation, my question was "What would be the best do 
in this eventuality"

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326281
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: GET insread of POST: what would you do?

2009-09-14 Thread DURETTE, STEVEN J (ATTASIAIT)

I cfparam both form and url forms of the variable.

Then I convert to Variables...









Of course you can do other checking as well.  You may also notice that
because of the order I trust the form variables more than the url
variables.

One thing though, if the values are showing up in the url then your form
itself must be using GET, otherwise they wouldn't show in the URL.

Steve


-Original Message-
From: Claude Schneegans [mailto:schneeg...@internetique.com] 
Sent: Monday, September 14, 2009 3:05 PM
To: cf-talk
Subject: GET insread of POST: what would you do?


Hi,

 From time to time, I find in my error log errors due to undefined form 
variables.
The reason being that the template was requested using method GET 
instead of POST.

Of course, there are dumb bots that would GET any address they find in a

page,
but there are also true visitors, even registered members, who will 
eventually cause the same error.

I've also noticed that if you are in a page submitted from a FORM, you 
click on the address bar in the browser
and press Enter, then the same page will be requested with a GET, and 
cause the same error.

Then I intend to write some tag that will check the method used in the 
request,
but my question is: what would you do - or already do -  in case of GET 
instead of POST?
- send some error response?
- send the user back to the correct empty form?
- send some Javascript code to go back in the history?



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326277
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


GET insread of POST: what would you do?

2009-09-14 Thread Claude Schneegans

Hi,

 From time to time, I find in my error log errors due to undefined form 
variables.
The reason being that the template was requested using method GET 
instead of POST.

Of course, there are dumb bots that would GET any address they find in a 
page,
but there are also true visitors, even registered members, who will 
eventually cause the same error.

I've also noticed that if you are in a page submitted from a FORM, you 
click on the address bar in the browser
and press Enter, then the same page will be requested with a GET, and 
cause the same error.

Then I intend to write some tag that will check the method used in the 
request,
but my question is: what would you do - or already do -  in case of GET 
instead of POST?
- send some error response?
- send the user back to the correct empty form?
- send some Javascript code to go back in the history?

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326276
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4