CodeIgniter Forums
creating multi-page form token? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: creating multi-page form token? (/showthread.php?tid=33390)



creating multi-page form token? - El Forum - 08-24-2010

[eluser]Corbee[/eluser]
Hi,

It's my first time to create a multi-page form, and I was told that I need a token to prevent it from getting errors when refreshing or clicking back, but I'm not sure how to implement it.

Does anyone know of a simple snippet that can be used to make this possible?

Thanks


creating multi-page form token? - El Forum - 08-24-2010

[eluser]CI_avatar[/eluser]
1. how to avoid resending of inputs:
You can prevent resending the inputs from your form by using redirection.

2. how to catch pressing back button

you are in current page form then you click submit
then current page = next page

after submit make a SESSION or COOKIE of the to save the current page.
every time the user refresh or click the back button, verify and redirect the user to the current page.


creating multi-page form token? - El Forum - 08-24-2010

[eluser]Corbee[/eluser]
but how do you trigger the redirection on refresh or resending of inputs?


creating multi-page form token? - El Forum - 08-24-2010

[eluser]CI_avatar[/eluser]
post updated


creating multi-page form token? - El Forum - 08-24-2010

[eluser]Corbee[/eluser]
Thanks, I'll try it