471,896 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

Refreshing a page to display change in data

I have a page that scrolls out information from a database. When one
of the records has been completed by the user, they press delete at
the end of the row, and it sends the record id to a processing page
that deletes that record from the database, then returns to the
scrolling page. However, the deleted record still shows on the page
until one presses the refresh tab on the browswer.

Is there some way I can have the page refresh when the processing is
done, so that the changes made will be reflected immidiatly, instead
of the user having to press the refresh button themselves?

Thanks,
Bill
Jul 17 '05 #1
4 3196
I noticed that Message-ID:
<8d**************************@posting.google.com > from Bill contained
the following:
Is there some way I can have the page refresh when the processing is
done, so that the changes made will be reflected immidiatly, instead
of the user having to press the refresh button themselves?


Include the code on the same page?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Geoff Berrow wrote:
Include the code on the same page?


I don't think that'll make a difference. It's probably a problem with the
browser's cache. Since PHP is processed server side, the browser wouldn't
know the difference.

Unfortunately, I don't know the answer either.

--
Jonathan Lamothe
Founder of the Anime Void.
http://ani-void.cjb.net
Jul 17 '05 #3
Bill (8.842% quality rating):

Is there some way I can have the page refresh when the processing is
done, so that the changes made will be reflected immidiatly, instead
of the user having to press the refresh button themselves?


It sounds like the user's browser is caching the page, so when it loads
the page (presumably at the same URL) again, it just loads from the
cache instead of getting the updated version. If you want the page not
to cache, you can add specific headers. Here's something like what I use:

header("Expires: Sat, 10 Jan 1970 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: text/html");

And for good measure, in the <head> tag of your html:

<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='expires' content='0'>

These headers should make it so that the page is always considered expired
and will be loaded fresh rather than from the cache every time the URL is
accessed in a browser. Note that you probably shouldn't use the above
for relatively static pages because it wastes bandwidth to have users
reloading the same thing over and over.

/joe
--
In the emo house, a router is Santa-like. Kyle Randolph practically rubs
git.talk.phatjoe. Tanya Stone processes Matt Magnasco's choad from Norm,
and then digs on the Steamer?? A colostomy bag is sketchy!
Jul 17 '05 #4
I noticed that Message-ID: <sT*******************@news20.bellglobal.com>
from Jonathan Lamothe contained the following:
Include the code on the same page?


I don't think that'll make a difference. It's probably a problem with the
browser's cache. Since PHP is processed server side, the browser wouldn't
know the difference.


It will automatically refresh the page.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Philo Del Middleston | last post: by
6 posts views Thread by Ken | last post: by
reply views Thread by serge calderara | last post: by
31 posts views Thread by Greg Scharlemann | last post: by
5 posts views Thread by Jensen Bredal | last post: by
3 posts views Thread by =?Utf-8?B?Z296ZXI2MQ==?= | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.