Welcome Guest, Not a member yet? Register   Sign In
advantages and disadvantages of redirecting
#1

[eluser]jwindhorst[/eluser]
I've come into a few situations where simply calling in the next view from a controller leaves a non-sensical URI. For example, I have a form that allows a user to add a request to a project. Once the request is sent from "/request/add" and is processed in "/request/process_add" I want to send the user to "/request/confirm". If I just call in that view, the URI would still say "/request/process_add".

So I been using flashdata and the redirect() function to get the user to the correct location and correct URI.

The question is, does anyone have any insight into what could be considered good or bad about doing things one way over the other. I realize there are SEO reasons for keeping the URI unique to the page, but are there any speed or security issues I should be looking for when considering one method over the other?
#2

[eluser]Michael Wales[/eluser]
For the most part I usually send a form to be processed within the same method, then upon a successful form validation perform whatever action is required and redirect to a new method.

There really aren't any speed or security issues you should worry about, in practice. Of course, it all depends on what you are actually performing during this process.




Theme © iAndrew 2016 - Forum software by © MyBB