Author Topic: Page refresh script  (Read 1948 times)

0 Members and 1 Guest are viewing this topic.

Offline Arthurhh

  • Senior Contributor
  • ****
  • Posts: 266
  • IT Fixer
    • Tokoroa Weather Live
Page refresh script
« on: February 14, 2009, 12:17:05 AM »
Well I have googled and googled and I must have a block about suitable keywords or what.  ](*,)

I am after a script which will refresh a page every minute but after 10 minutes stop refreshing and pop up a prompt to the user asking if they wish to continue refreshing the page. An anti page camping script effectively.

Anyone got any ideas

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Page refresh script
« Reply #1 on: February 14, 2009, 01:12:13 PM »
Just put this in your page
Code: [Select]
<meta http-equiv="refresh" content="60">
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Page refresh script
« Reply #2 on: February 14, 2009, 01:17:03 PM »
lars, if you re-read his request... It is for a "smart" refresh.   load every x seconds, then ask if they want to continute.... so the visitor does not unknowingly or intentional park on the page and make it work all day...
Andrew

Just put this in your page
Code: [Select]
<meta http-equiv="refresh" content="60">

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Page refresh script
« Reply #3 on: February 14, 2009, 01:21:45 PM »
lars, if you re-read his request... It is for a "smart" refresh.   load every x seconds, then ask if they want to continute.... so the visitor does not unknowingly or intentional park on the page and make it work all day...
Andrew

Sorry, I did not read the full text  :oops: :oops:
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline Arthurhh

  • Senior Contributor
  • ****
  • Posts: 266
  • IT Fixer
    • Tokoroa Weather Live
Re: Page refresh script
« Reply #4 on: February 14, 2009, 07:40:25 PM »
lars, if you re-read his request... It is for a "smart" refresh.   load every x seconds, then ask if they want to continute.... so the visitor does not unknowingly or intentional park on the page and make it work all day...
Andrew

Just put this in your page
Code: [Select]
<meta http-equiv="refresh" content="60">

Your on to it  :-P
It is a static page which has to be refreshed to get new values. I know about the meta refresh and even a few java script refreshes but none of those will prevent someone logging into the page all day and consuming a heap of bandwidth.
The problem is that any variable used to count the refresh and stop it after so many gets destroyed by the refresh.
I am considering doing it as a part of the URL, but that is fraught with risk from code injection.
eg http://chh-p.dyndns.org/index1-gaugues.php?refresh1
    http://chh-p.dyndns.org/index1-gaugues.php?refresh2
    http://chh-p.dyndns.org/index1-gaugues.php?refresh3 (and so on till limit reached)

 

anything