Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-10-2005, 04:59 PM   #1 (permalink)
berg
Registered User
 
Join Date: Feb 2005
Posts: 2
berg is on a distinguished road
html code to refresh webpages when visited

is there an html code that enables pages on my website refresh automatically when a visitor goes to specific pages on my site? It has to refresh just once...when the page loads.
berg is offline   Reply With Quote
Old 02-10-2005, 05:24 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
HTML Code:
<META HTTP-EQUIV="Refresh" CONTENT="3;URL=mypage.html">
that would refresh your page 'mypage.html' every 3 seconds. you just want it to refresh once?

i don't understand you just want it to refresh once when the page loads. a page load is essentially a refresh anyway.
__________________
Mike
sde is offline   Reply With Quote
Old 02-11-2005, 01:29 AM   #3 (permalink)
berg
Registered User
 
Join Date: Feb 2005
Posts: 2
berg is on a distinguished road
what am i doing wrong?

I placed this code on my page <META HTTP-EQUIV="Expires" CONTENT="0"> ...but for some reason it doesnt load up my updates on the page. am i doing something wrong?
berg is offline   Reply With Quote
Old 02-20-2005, 04:11 AM   #4 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
You mean you want something on the page to change dynamically upon a visit? Like what happens with a counter?

Well explain what exactly and we can further help. It sounds like you want something beyond HTML.
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 02-20-2005, 06:22 AM   #5 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
So the browser is caching the page for too long?

(wow, haven't seen DavH around here in awhile)

-r
idx is offline   Reply With Quote
Old 03-05-2005, 09:05 AM   #6 (permalink)
Big_Bad_Wolf
Registered User
 
Join Date: Mar 2005
Posts: 1
Big_Bad_Wolf is on a distinguished road
Copied from a tutorial I found on another website while looking for the same thing:
Expiration
If you want to have your page "expire," here's how to set it:

<META HTTP-EQUIV="expires" CONTENT="thu, 31 DEC 2002 00:04:00 EST">

What this means in the real world is that your visitors' browsers will use the cached version of your page, if available, until the specified date and time are reached, at which time the page will reload from the server the next time it's visited. To force your visitors' browsers to reload your page from the server (i.e. always use the most recent content) on every visit, use the following:

<META HTTP-EQUIV="expires" CONTENT="0">

META Cache-Control

This tag keeps your page from being automatically cached by servers or browsers. AOL, for example, usually stores cached pages on its servers, which means that AOL users may view cached (i.e. old) copies of pages without being able to see the updated versions. Although caching pages speeds loading times, if your page is updated frequently, I suggest you use the no-cache tag to make sure your visitors always get the most recent version of your page:

<META HTTP-EQUIV="Cache-Control" CONTENT ="no-cache">

The following tag works specifically on Netscape browsers:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">


What I think berg meant was indeed that he wants to prevent his visitors to use cache versions of his site, so that they always get the most recently updated versions of the pages.
There's also some javascript coding which according to another website is the preferred way, but I don't really see how these ways differ to the visitor, so perhaps that's just a matter of taste.
Then again, I'm not a real expert, I just play one on IRC
Big_Bad_Wolf is offline   Reply With Quote
Old 02-19-2006, 08:31 PM   #7 (permalink)
krmidas
Registered User
 
Join Date: Feb 2006
Posts: 1
krmidas is on a distinguished road
Unhappy Netscape won't auto-refresh an image

Quote:
Originally Posted by Big_Bad_Wolf
Copied from a tutorial I found on another website while looking for the same thing:
Expiration
If you want to have your page "expire," here's how to set it:

<META HTTP-EQUIV="expires" CONTENT="thu, 31 DEC 2002 00:04:00 EST">

What this means in the real world is that your visitors' browsers will use the cached version of your page, if available, until the specified date and time are reached, at which time the page will reload from the server the next time it's visited. To force your visitors' browsers to reload your page from the server (i.e. always use the most recent content) on every visit, use the following:

<META HTTP-EQUIV="expires" CONTENT="0">

META Cache-Control

This tag keeps your page from being automatically cached by servers or browsers. AOL, for example, usually stores cached pages on its servers, which means that AOL users may view cached (i.e. old) copies of pages without being able to see the updated versions. Although caching pages speeds loading times, if your page is updated frequently, I suggest you use the no-cache tag to make sure your visitors always get the most recent version of your page:

<META HTTP-EQUIV="Cache-Control" CONTENT ="no-cache">

The following tag works specifically on Netscape browsers:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">


What I think berg meant was indeed that he wants to prevent his visitors to use cache versions of his site, so that they always get the most recently updated versions of the pages.
There's also some javascript coding which according to another website is the preferred way, but I don't really see how these ways differ to the visitor, so perhaps that's just a matter of taste.
Then again, I'm not a real expert, I just play one on IRC

I've followed some of these instructions, but I'm pulling my hair out (what's left of it). There's a weather map on the top of my page that refreshes every 10 minutes. I want the latest version of that map displayed on my page, but with netscape, it only updates if I click "refresh". With Firefox and Explorer it seems to update fine. I inserted the following code, but to no avail:

<head>
<meta http-equiv="expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">

The address of my page is:

http://pweb.netcom.com/~krmidas/yyyweather.htm

Any suggestions?

-Tom
krmidas is offline   Reply With Quote
Old 02-19-2006, 11:21 PM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
i don't have netscape installed to try, .. but try setting the expires parameter to -1 instead of 0.
HTML Code:
<meta http-equiv="Expires" content="-1" />
are you using just html? or does your page support some type of server-side language also?

it's probably not good, but i don't even worry about netscape users anymore.
sde is offline   Reply With Quote
Old 02-20-2006, 04:27 AM   #9 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
IMO http-equiv is mostly used for IE only and still does fail in IE
if you have server-side scripting support like SDE says, you should think about using something like PHP
PHP Code:
<?php
header
('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header('Date: '.date('D, d M Y H:i:s \G\M\T', (time()-date('Z'))));
DJMaze is offline   Reply With Quote
Old 02-20-2006, 04:29 AM   #10 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
forgot to mention that i use Cache-Control: private
this prevents proxies from caching it but not on the client side
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco Code breaking sde Code Newbie News 0 05-21-2004 07:10 AM


All times are GMT -8. The time now is 08:29 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting