WXforum.net
May 21, 2013, 08:55:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6617  •  Posts: 178519  •  Topics: 18115
Please welcome TheMOX, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Http-equiv Meta Refresh  (Read 1338 times)
0 Members and 1 Guest are viewing this topic.
Arthurhh
Senior Contributor
****
Offline Offline

Posts: 251


IT Fixer


WWW
« on: October 18, 2008, 06:46:28 PM »

I have a page I would like to refresh on a 60 second period, but I would like it to only refresh x number of times before stopping any further refreshes.

Anyone point me towards a resource that may have this functionality as std meta refresh goes forever (or untill page closed by user)

Javascript is fine PHP is fine even though the page is a html one I could modify (I Hope to use PHP)
« Last Edit: October 18, 2008, 06:53:18 PM by Arthurhh » Logged

SLOweather
Administrator
Forecaster
*****
Offline Offline

Posts: 2343



WWW
« Reply #1 on: October 18, 2008, 07:34:15 PM »

Somebody else will undoubtedly come up with something more elegant, but...

You make X number of pages, where X = the number of refreshes. They are all copies of each other except for the refresh tag. /index.htm refreshes to index1.ht. /index1.htm refreshes to index2.htm etc up to indexX.htm. /indexX.htm has no refresh tag.

And, you can meddle with the time delay at each refresh this way if you want, changing the time delay each time.

All html, no scripting, kinda clunky...

I have a page I would like to refresh on a 60 second period, but I would like it to only refresh x number of times before stopping any further refreshes.

Anyone point me towards a resource that may have this functionality as std meta refresh goes forever (or until page closed by user)

Javascript is fine PHP is fine even though the page is a html one I could modify (I Hope to use PHP)
Logged
Arthurhh
Senior Contributor
****
Offline Offline

Posts: 251


IT Fixer


WWW
« Reply #2 on: October 18, 2008, 07:49:23 PM »

Somebody else will undoubtedly come up with something more elegant, but...

You make X number of pages, where X = the number of refreshes. They are all copies of each other except for the refresh tag. /index.htm refreshes to index1.ht. /index1.htm refreshes to index2.htm etc up to indexX.htm. /indexX.htm has no refresh tag.

And, you can meddle with the time delay at each refresh this way if you want, changing the time delay each time.

All html, no scripting, kinda clunky...

I have a page I would like to refresh on a 60 second period, but I would like it to only refresh x number of times before stopping any further refreshes.

Anyone point me towards a resource that may have this functionality as std meta refresh goes forever (or until page closed by user)

Javascript is fine PHP is fine even though the page is a html one I could modify (I Hope to use PHP)

Oh how nice if it was just that simple, since the page uploads each time it wont quite fit this method, and that was something I forgot to mention the page is myb cumulus index.htm so it uploads regularly. see http://chh-p.dyndns.org
Logged

SLOweather
Administrator
Forecaster
*****
Offline Offline

Posts: 2343



WWW
« Reply #3 on: October 18, 2008, 09:06:47 PM »

Ok, then use iframes or PHP includes to include an uploaded data table onto each page.
Logged
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3729


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #4 on: October 18, 2008, 11:01:25 PM »

This is a tricky problem.  The reason is that only the browser honors the <meta> refresh directive .. if it's in the page that's loaded, then the timer starts and the reload action will take place when the timer interval is done.  The only way to stop it is to not emit a <meta> refresh tag in the page .. then it will sit there until the browser is closed (or another page opened in that window/tab).

Secondly, the HTTP protocol is 'stateless' in that the webserver doesn't 'remember' how many times it's coughed up a particular page to a particular IP address.  But the browser has a memory capability in 'cookies' that can be accessed by both JavaScript and PHP .. but not everyone allows cookies, so it's not a reliable mechanism for counting times.  PHP also has sessions support (Mike Challis and I use sessions and cookies for storing preferences in the WD/AJAX/PHP template set). 

I think SLOweather Chris' idea of a sequence of HTML pages (all the same content, but with a sequence number and the last one with no <meta> refresh) is the best idea to solve the problem.   Since you're using HTML only, you could do this with a series of pages that differ only by the <meta> refresh, and use SSI to include the page content into the harness page.  That way, the same content could be used by all the clone pages.

Hope this helps...
Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
W Thomas
Welcome To My World Of Dishes
Forecaster
*****
Offline Offline

Posts: 1401


In Loving Memory Of Hooker The Weather Dog !


WWW
« Reply #5 on: December 07, 2008, 10:24:21 PM »

I have been throwing this idea around for awhile myself. Exactly where could I find such a html code string and where is it best placed in the page?
It looks as if my switch to another server will be after the new year sometime so for now I'm stuck with whatever a M$ ASP based server can do..

except crash..that is Smile  That doesn't cost extra ..so far!

Wayne
www.smythweather.net
CW8217
Logged



     Best Regards
     Wayne
CW8217
CoCoRaHS VA-SM-1
KVAMARIO3 Wunderground 
VWS 14.00 P45   OS WMR 968 &  Davis Vantage VUE / Dedicated Server
GR Level 3 ,Level 2 AE Radars  Weather Display 10.37P  Mid Atlantic Weather Network Member
SkyWarn & Spotter Network 6092
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.103 seconds with 19 queries.
anything