Currently, I am facing an issue where the SESSION variable is appearing before it has been defined.
My website, Index.php, has a design with a frame. Within Index.php, there is code that looks like this:
<div id='message2' onclick="closeNotice2()" style="display: none">
<? echo $_SESSION["user_message_123456"]; ?>
</div>
Inside the frame, there is an insert.php file that stores data to user_message_123456.
Before the data has been stored, it appears as undefined. Even after storing the data, it still shows as undefined until the page is refreshed (F5).
I would like for the session data to display without needing a page refresh after it has been stored.
I understand that this is happening because the $_SESSION variable is called when loading Index.php and is not defined until insert.php is run. I am looking for an alternative method to achieve this.
Any suggestions or examples on how to accomplish this would be greatly appreciated!