By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Refreshing a page to display change in data

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.