return error from form |
Hi,
I'm trying to use Language files in CI4 for (amongst other things) customs errors. However, I'm not sure how to construct a response to a form submission with a customer error? PHP Code: if(empty($a) && !empty($b)) { I'm sure there is a simple process to achieve this? Any assistance is appreciated
Wow,
very cool. Thank you. Also looks like I need to use myth:Auth instead of trying to reinvent the wheel. Many thanks.
Your very welcome.
A lot of us on here are using it, I use it with Boilerplate which is AdminLTE 3 backend Dashboard. and I' am adding my Blog into it now. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-23-2020, 08:45 AM)InsiteFX Wrote: Your very welcome. Yes I'm getting on with it very well. Just one question though? When I login the user I set additional session data (AuthController::attemptLogin), this works very well. However, if session expires and user is still logged in ($this->auth->check()) I need to add the additional session data again. PHP Code: public function login() So I tried to configure a filter to check the session data exists and if not, redirect to login. But I get caught in an infinite loop. Filter PHP Code: public function before(RequestInterface $request) { I'm not sure why because if I type http://mysite/login direct into browser, all is OK Any ideas?
If the session is logging out you will need to add it again, you can up the session timeout
so that this does not happen. sessionExpiration = 0 Will destroy the session on web browser exit. seconds -----------------------------| minutes -----------------------| | hours -------------------| | | days -----------| | | | years ------| | | | | y d h m s time () + (20 * 365 * 24 * 60 * 60) What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-24-2020, 08:06 AM)InsiteFX Wrote: If the session is logging out you will need to add it again, you can up the session timeoutMany thnaks, but I was more concerned why there was an infinite loop when trying to redirect to the login page? Code: if($uri->getPath!='login' )
Only thing I can think of would be your redirect.
Check your if user_id it might not be removed. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |