![]() |
An Error Was Encountered - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: An Error Was Encountered (/showthread.php?tid=62065) |
An Error Was Encountered - rahulb - 06-06-2015 I wrote the below code for form validation. When a mandatory field is not entered then is shows proper message, but when I press F5 and resubmit my form then I get error "An Error Was Encountered - The action you have requested is not allowed.". How shall I remove this error? Below is my code. Thank you In advance View: Code: <?php config/form_validation.php PHP Code: $config = array( Controller PHP Code: if ($this->form_validation->run('department') == FALSE) RE: An Error Was Encountered - Blair2004 - 06-06-2015 Hi, can you upload a thumb so that we can see how the error is displayed ? RE: An Error Was Encountered - pdthinh - 06-06-2015 Hi, you should check the following config item: PHP Code: $config['csrf_regeneration'] = TRUE; modify it to FALSE may work. See more http://www.codeigniter.com/user_guide/libraries/security.html#cross-site-request-forgery-csrf RE: An Error Was Encountered - rahulb - 06-06-2015 (06-06-2015, 11:25 AM)pdthinh Wrote: Hi, Kindly let me know is there any way where I can enable the CSRF_REGENERATION and the error will get resolved RE: An Error Was Encountered - Avenirer - 06-08-2015 The idea with CSRF is exactly for you not to resubmit the same form twice. The alternative solution would be to do a redirect (to the same controller/function if you want to return tot the form after submitted some data) after you saved the form data. |