Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 27th September 2002, 8:41 AM   #1
zeuss Thread Starter
Member
 
zeuss's Avatar
 
Join Date: Jul 2001
Location: Hawthorn East, Melbourne
Posts: 276
Default Web Page Refresh

I've got a feeling that what I'm about to ask is really easy, but I've got no idea how to fix this problem...

I'm setting up a web site for uni, with HTML, PHP, cgi (perl) and JavaScript code. The server is Apache, running on a Solaris machine. The web site features a web-based email client, which displays messages stored on the server. Each user has an 'Inbox', which lets them view a list of message headers that they can click through to see an entire message.

The problem is that certain browsers are caching the 'Inbox' page. Therefore if the user deletes a message and returns to the list, the page is not updated. So I think I'm looking for a way to set a specific page (inbox.html) as 'un-cachable', or to make the browser realise that the page is dynamic and should be checked for changes.

Any ideas or suggestions would be great.
Thanks,
ZeUSS.
__________________
Never trust a programmer who carries a screwdriver.

ZeUSS - PCDB Entry
[Lian Li PC-60USB | Asus A7N8X 2.0 | AthlonXP 2800@2250MHz | 1Gb PC3200 Dual-DDR RAM | Leadtek 64Mb GeForce4 4200 (core@315 mem@580)]
zeuss is offline   Reply With Quote

Join OCAU to remove this ad!
Old 27th September 2002, 10:19 AM   #2
mpot
<blank>
 
mpot's Avatar
 
Join Date: Jun 2001
Location: Perth, WA
Posts: 5,345
Default

You need to add some headers to tell the web server / browser not to cache the page.

Try this page.

Cheers,
Martin.
__________________
[ photography blog | redbubble | flickr ]
mpot is offline   Reply With Quote
Old 27th September 2002, 10:25 AM   #3
Bern
Off the rails
 
Bern's Avatar
 
Join Date: Jun 2001
Location: Brighton, QLD
Posts: 5,000
Default

You can use a meta refresh to reload the page, however this will keep refreshing over and over, a better soultion would be to use some javascript, a quick google should provide a few hints.
__________________
Bern is offline   Reply With Quote
Old 27th September 2002, 11:25 PM   #4
DRILL SGT
Member
 
Join Date: Feb 2002
Location: Brisbane
Posts: 511
Default

Umm, you could create a frame for the inbox.html, then
Code:
src for control.htm
assumed you have all the html structure etc
<script language="javascript">
function sniper(){
parent.frames[1].location.reload() //this is a "hard" reload doesn't go throught the history, softload is history.go(0)
}
</script>
<body onload="sniper()">
That will hardreload the page when ever it is loaded, hope it helps
DRILL SGT is offline   Reply With Quote
Old 28th September 2002, 8:53 AM   #5
cogo
Member
 
Join Date: Jan 2002
Location: mel-burn
Posts: 255
Default

we had a similar problem with a HR app we built. we solved it by putting a date stamp on the end of a page request;

page.asp?Refresh=9/28/02+8:45:26+AM

that way you trick the browser to think that the page is unique.
cogo is offline   Reply With Quote
Old 3rd October 2002, 11:57 AM   #6
zeuss Thread Starter
Member
 
zeuss's Avatar
 
Join Date: Jul 2001
Location: Hawthorn East, Melbourne
Posts: 276
Default

I ended up putting links everywhere to a different page, which sends the user to a refreshed version of the page, ie if i want the user to go back to 'index.php', i send them to 'inboxUpdate.html', which has the following code:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Inbox Update Redirect</title>
    <meta http-equiv="refresh" content="0; url=inbox.php">
  </head>
</html>
Thanks for your help guys
__________________
Never trust a programmer who carries a screwdriver.

ZeUSS - PCDB Entry
[Lian Li PC-60USB | Asus A7N8X 2.0 | AthlonXP 2800@2250MHz | 1Gb PC3200 Dual-DDR RAM | Leadtek 64Mb GeForce4 4200 (core@315 mem@580)]
zeuss is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 8:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!