I am using an auto refreshing div to display my users new messages icon as a numeric value. I wanted to play a notification tone when the user receives a new message but I am running into some issues and I am hoping someone can help.
The problem I am having is that when I try to set $_SESSION['inbox'] = $inbox_new; to indicate the message is no longer new on the next refresh the system acts like there is no new message and ignores anything else I try to tell it to do before the next refresh. $sound will not get “set” and when I echo “Test” it never echo’s. it is like it is making the original ‘if’ statement void.PHP Code:
if($inbox_new > $_SESSION['inbox'])
$_SESSION['inbox'] = $inbox_new;
$sound = 'SET';
I basically need a script that shows two variables.
$a and $b where $a is from the database and $b is the last known number of the database without calling it.
I am NOT asking about auto refreshing divs btw…
I have no idea if I am making any sense here but I have spent the last 12 hours trying to figure a work around on this and am at my wits end. Any help is much appreciated.