I am working on site. I uses some custom error/success
messages for front end form but currently it display messages to on same page, But as soon as I refresh the page or redirect the user to next page messages not save. To save the success messages
I use the code
$success = __('You have successfully Login.', 'frontendprofile');
And for the error messages I use the default varible that is $error
. How can save them the for next page or for when if I refresh the page?
You could save the messages in a
$_SESSION
variable. This way, the values will be preserved untill you decide to remove them again.Something like this.
You can use it like follows: