Re: Clear POST variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 16, 2006 at 02:07:33PM -0600, Richard Lynch wrote:
> On Thu, February 16, 2006 9:15 am, John Wells wrote:
> > I'm curious to hear what others say, but I tend to build into my
> > application flow a header("Location: someurl") redirect after a form
> > submission.  It's just as if you were to include("somefile") the
> > resulting page, but by using header() you are moving the user away
> > from the action so that this sort of thing won't happen.  In my
> > experience it also helps with a user's tendency to use the back
> > button--which is not "wrong", it can just get in the way of rich
> > applications.
> 
> If it's not "wrong" for me to push the "back" button, why are you
> breaking it with all your re-directs :-)
> 
> Seriously, I think the re-direct feature is the most over-used and
> abused feature.

It really comes down to how you build your application and how it
behaves on a POST. If the application is designed to post something
and come back to the same page, a redirect makes sense after the action
occurs.  But then again you have to worry about how to transmit a
mesage back saying the action is done.

Honestly, i think the abuse of the re-direct is due to the commonly
used browser, IE. If you hit back an ugly message comes up warning
the person that it is going to re-post data, if they hit OK and you
protect against it (like the solution you give later in this
thread) your ok, but if they hit cancel, they get an 'Expired
Page'.  The redirect avoids that issue.

> 
> It's also wasteful of HTTP connections which will kill a busy server,
> and does not scale well.

If the server supports keep-alive connections the client most
likely will use the same connection to make the redirect.


> 
> I generally find that if I sit down and figure out why there is a
> re-direct, and then code the application so that I don't need the
> re-direct, because I've gathered/generated the information in advance
> or re-structed things to not need the re-direct, I end up with a far
> more clean and sensible design in my code-base.

I'm always 100% for thinking things through!

Curt.
-- 
cat .signature: No such file or directory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux