Tokenizer to prevent double posting of data (and rerunning validation routines) - 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: Tokenizer to prevent double posting of data (and rerunning validation routines) (/showthread.php?tid=10655) |
Tokenizer to prevent double posting of data (and rerunning validation routines) - El Forum - 08-07-2008 [eluser]drewbee[/eluser] Hello again everyone! As I go through code igniter even further, I have come up with this nice little trinket to prevent double posting of data. Should a user double post data, the 'success' message will still be displayed (without running validation / queries again). If anyone can see any issues with this, please let me know. The difference with this is that the form will still hold the 'post' data within it (no redirects). Note: requires session & validation Libraries CIEXT_Validation Code: function run() Controller: Code: // Yay! Were using the tokenizer!! Pretty Neat, I think. However, I can already see one issue that I need to do checking against... and that is if the user idles on the site and looses the session value... and the form has already been posted I will end up with an undefined index. Can anyone else see any other issues with this? (sorry about the templating thing, but the general idea behind CI's controller process is there) Tokenizer to prevent double posting of data (and rerunning validation routines) - El Forum - 08-08-2008 [eluser]drewbee[/eluser] No one sees any issues with this? I can hardly doubt that! Especially for how quick I threw it together. |