Welcome Guest, Not a member yet? Register   Sign In
CI4 session_write_close() when redirect
#2

(This post was last modified: 06-18-2021, 04:59 AM by includebeer.)

PHP Code:
->with('validation'$validation

You can't save $validation in the session like that. It's an instance of the validation library, that's why it crashes in session_write_close().

Here is an example to send the error messages to the redirected page. Use validate() to validate the rules, then use validator to get the error messages.
You can see a detailed example in this tutorial: https://includebeer.com/en/blog/how-to-b...r-4-part-6

PHP Code:
if ( ! $this->validate($rules))
{
    return redirect()->back()->withInput()->with('errors'$this->validator->getErrors());

Reply


Messages In This Thread
RE: CI4 session_write_close() when redirect - by includebeer - 06-18-2021, 04:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB