Welcome Guest, Not a member yet? Register   Sign In
set_value() with redirect() issue
#18

[eluser]Aken[/eluser]
You don't have to write the same code twice to process a form. If you think you do, you're doing something wrong. If you have a form that shows up in multiple places (like a login form on every page, for example), the form's action should point to a single page, like example.com/login. If the login fails, then that form will reload at example.com/login, retaining the POST data.

Why would I suggest not redirecting after a failed form? Maybe for the exact reason that this thread exists in the first place -- the POST data disappears, and you have to add extra work-arounds to retain it after the redirect.

If the entire purpose of the redirect is to get the user back to the original page, then you can retain that data in their session info and bring them back upon successful form submission. That's the normal way of doing it.


Messages In This Thread
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:40 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:45 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:47 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:51 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:30 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:31 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:34 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 07:19 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:20 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:41 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:42 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:50 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 09:16 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 09:19 AM
set_value() with redirect() issue - by El Forum - 02-08-2013, 12:47 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 01:29 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 02:41 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 05:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB