Display updated MySQL
Thanks in advance.
$query="delete from `messages` where `messageid` = '$record'";
/// I've tried adding usleep(3000) here as well
$query="select * from `messages` where `to` = '".$_SESSION['profileid']."'";
$_SESSION['messagecount']=$result->num_rows; /// This is the number that should refresh on redirect
Deleting messages ...
I'm guessing that on the redirect the form is using the latest cached copy of the page, then when you refresh it the browser actually requests a fresh copy from the server. You could try setting some no-caching headers on the main page and see if that helps.
(My personal preference is to avoid redirects in the first place, instead using a single page approach (e.g. a single controller such as used in most MVC frameworks).)
Hi NogDog -
Thanks for the reply. Where do I put these in my script? I put them in the <head></head> tags, and got the error messages that headers have already been sent.
It would need to be done before anything actually gets output to the browser (including anything not within <?php ... ?> tags). So it might be something like:
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past