Welcome Guest, Not a member yet? Register   Sign In
Form Validation
#7

If the posted data a user provides is valid I first insert/update/delete the database. After that I store a success message in a session and redirect to the main page. There the message is being shown (and removed from the session).

Flashdata could be used but I feel it is somewhat unreliable as it is cleared during the next load. In some cases the flash data is cleared before it is shown to the user (for example if there is another redirect in place or some error occurred). I created my own messages library which stores these succes and error messages and only removes them when it is presented to the user. My library was inspired by Jens Segers but I recently found another one which does about the same.

https://github.com/jenssegers/codeignite...ge-library
https://github.com/avenirer/CodeIgniter-Rat
Reply


Messages In This Thread
Form Validation - by ignitedcms - 08-04-2015, 11:11 AM
RE: Form Validation - by mwhitney - 08-04-2015, 01:36 PM
RE: Form Validation - by Diederik - 08-04-2015, 03:02 PM
RE: Form Validation - by ignitedcms - 08-04-2015, 03:40 PM
RE: Form Validation - by Diederik - 08-04-2015, 10:36 PM
RE: Form Validation - by ignitedcms - 08-05-2015, 12:08 AM
RE: Form Validation - by mwhitney - 08-05-2015, 07:26 AM
RE: Form Validation - by Diederik - 08-05-2015, 01:43 AM
RE: Form Validation - by Wouter60 - 08-05-2015, 06:50 AM
RE: Form Validation - by CroNiX - 08-05-2015, 07:20 AM
RE: Form Validation - by ignitedcms - 08-05-2015, 11:55 AM
RE: Form Validation - by mariek - 08-14-2015, 08:40 AM
RE: Form Validation - by mwhitney - 08-14-2015, 09:54 AM
RE: Form Validation - by mariek - 08-17-2015, 12:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB