Welcome Guest, Not a member yet? Register   Sign In
set_flashdata stays open
#8

(03-22-2021, 12:12 PM)pedreitor Wrote:
(03-18-2021, 02:27 PM)php_rocs Wrote: @pedreitor,

This line should be at the footer of the page.  Not the header.
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>

Try the above.
see example code: view-source:https://codeseven.github.io/toastr/demo.html
Hi again, php_rocs.

I have managed to make it work, with SweetAlert I have managed to get the messages to appear correctly on the screen. But the original problem reappears.

It seems that the set_flashdata messages remain active during all the time, because when I redirect the page or change to another link, the SweetAlert message appears again.

This leads me to think that somehow these flash_data messages stay in the session and the code detects that it has just arrived, so it shows the message again on the screen.

Any idea why this is happening?

Thank you in advance again! You are helping me so much.
Hi, I have more news.

I have tried doing a print_r of $this->session->flashdata on the top of the header, inside de body tag (in wich the flashdata are displayed), and this is what I found.

Array ( [usuario_logout] => [usuario_login] => [usuario_login_fallido] => [partido_actualizado] => El partido ha sido actualizado con éxito. [competicion_actualizada] => La competición ha sido actualizada con éxito. )

The messages appear in spanish because I'm from Spain. I try to translate as much as I could, but in this case, I think that is not important.
The thing is that it doesn't seem to clear the variable after each redirect, so it concatenates each message, one after the other, and I think that's why it shows all of them at once, instead of just showing the last message and clearing itself.

I really don't have a clue of what to do here. I'm really stuck on this.
Any help is appreciated.
Thanks in advance.
Reply


Messages In This Thread
set_flashdata stays open - by pedreitor - 03-16-2021, 04:16 AM
RE: set_flashdata stays open - by php_rocs - 03-16-2021, 06:55 AM
RE: set_flashdata stays open - by pedreitor - 03-17-2021, 09:05 AM
RE: set_flashdata stays open - by php_rocs - 03-18-2021, 08:04 AM
RE: set_flashdata stays open - by pedreitor - 03-18-2021, 12:03 PM
RE: set_flashdata stays open - by php_rocs - 03-18-2021, 02:27 PM
RE: set_flashdata stays open - by pedreitor - 03-22-2021, 12:12 PM
RE: set_flashdata stays open - by pedreitor - 03-22-2021, 02:20 PM
RE: set_flashdata stays open - by InsiteFX - 03-22-2021, 08:45 PM
RE: set_flashdata stays open - by pedreitor - 03-23-2021, 03:24 AM
RE: set_flashdata stays open - by php_rocs - 03-23-2021, 06:29 AM
RE: set_flashdata stays open - by demyr - 03-23-2021, 02:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB