Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member jsarber's Avatar
    Join Date
    Nov 2009
    Posts
    17
    Member #
    20416
    I'm looking for a way to refresh a page, not in time intervals, but at a certain time of the day. For instance, I want the page to refresh at 9 a.m. (server time) each day. Even better, I would like it to refresh about 5 seconds after 9 a.m.

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,639
    Member #
    1234
    Liked
    136 times
    What would the use be of refreshing a page once a day? If it's dynamic w/ PHP and mySQL like your other thread, if the data yodates, so does the page when it's next requested.

    Or are you wanting to ensure that if someone happens to load the page at 8:59 AM server time and the page is updated a minute later that they have the latest info? FYI some users may want to look at old data on purpose (depending on the function of course).
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com
    Founder/Creator/Admin of ZE SECRET PROJECT!
    New Game: http://www.wats.it
    DWM Software Co. - software . mobile . database . hosting . design

  4. #3
    Junior Member jsarber's Avatar
    Join Date
    Nov 2009
    Posts
    17
    Member #
    20416
    Quote Originally Posted by Wired
    Or are you wanting to ensure that if someone happens to load the page at 8:59 AM server time and the page is updated a minute later that they have the latest info? FYI some users may want to look at old data on purpose (depending on the function of course).
    That's exactly why. Even if it refreshes when they are trying to listen to the archived content, they can still do so after it refreshes. But they can't listen to the live content unless it refreshes. I've received several emails from listeners that went to my website to listen to the live show and complained they only heard an old one. Unfortunately, they didn't think to refresh the page. I'm just trying to make it fool-proof.

  5. #4
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,639
    Member #
    1234
    Liked
    136 times
    Are the links to the broadcast dated, and how long are they?

    Personally I'd date the broadcasts in the file name as well as the link. That way there's no questions as to what day it was from.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com
    Founder/Creator/Admin of ZE SECRET PROJECT!
    New Game: http://www.wats.it
    DWM Software Co. - software . mobile . database . hosting . design

  6. #5
    Junior Member jsarber's Avatar
    Join Date
    Nov 2009
    Posts
    17
    Member #
    20416
    There's no date as they appear in the flash player. Each show is an hour long.

    I've thought about adding a link that would refresh the page and remind folks to do so. But I'd prefer an auto-refresh option. Is there one or no?

  7. #6
    Senior Member paintingtheweb's Avatar
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    128
    Member #
    15503
    well technically you can do this, although it would be a bit of a waste of resources on the client's machine. You could check the server time via an ajax request every minute or so and if the time is "update time" then refresh the page using javascript. The best way to do this would probably be to have a function on the server that will send back a boolean value that tells javascript to refresh the page or not. What server side language are you using? PHP? If so it could go something like this (not tested):

    PHP (ex. checkTime.php):
    Code:
    <?php
    	$time = date('H:i');
    	if($time == '09:00'){
    		echo "true";
    	}else{
    		echo "false";
    	}
    ?>
    Javascript (using jQuery):
    Code:
    <script type="text/javascript">
    $(document).ready(function(){
    	setInterval("checkTime()", 60000); //60 seconds between checks
    	function checkTime(){
    		$.ajax({
    			url: 'checkTime.php',
    			success: function(refresh){
    				if(refresh == "true"){
    					location.reload(true);
    				}	
    			}
    		});
    	}
    
    });
    </script>

  8. #7
    Junior Member jsarber's Avatar
    Join Date
    Nov 2009
    Posts
    17
    Member #
    20416
    I appreciate your help. Unfortunately, the page does not refresh. I've tried finding the problem on my own but to no avail.

  9. #8
    Senior Member paintingtheweb's Avatar
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    128
    Member #
    15503
    Well using the code provided the page won't refresh unless it's 9:00 am - did you change the PHP to a different time to test it?

  10. #9
    Senior Member paintingtheweb's Avatar
    Join Date
    Jul 2007
    Location
    Las Vegas
    Posts
    128
    Member #
    15503
    I actually found a bug in my code - I edited the original post.

  11. #10
    Junior Member
    Join Date
    Nov 2009
    Posts
    2
    Member #
    20395
    Maybe I should voice out my thoughts about this since I've tried it before. Well, basically, configure your code setting with PHP that at time your page will refresh.

    Miltski


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

how to make a web page refresh at a cutian time of day with javasript

,

how to refresh a webpage at particular time

,

html refresh page on the hour

,

log in web page at a particular time

,

refresh a webpage at a certain time each day

,

refresh html at a particular time

,

refresh html page at a specific hour

,

script to refresh page at certain time

,

stop refreshing a website at certain time

,

time of day page was refreshed

Click on a term to search for related topics.
All times are GMT -6. The time now is 05:07 PM.
Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com