TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-07-2010, 09:11 AM   #1 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default Countdown timer with php

I have not worked a lot with javascript in the past. What I am trying to is make it count down live with javascript and php. The php statement is
PHP Code:
<?=countup($site[cron5min]+300)?>
this is what I have up now but you have to refresh the page to see that the time has gone down. I want the javascript to do it live and automatically refresh when it gets to zero because it will restart the countdown. Can anyone help me out?
KingOfTheSouth is offline  
Reply With Quote
Old 09-07-2010, 11:31 AM   #2 (permalink)
The Acquainted
 
EyeDentify's Avatar
 
Join Date: Nov 2007
Location: Sweden
Posts: 106
Thanks: 13
EyeDentify is on a distinguished road
Default

Quote:
Originally Posted by KingOfTheSouth View Post
I have not worked a lot with javascript in the past. What I am trying to is make it count down live with javascript and php. The php statement is
PHP Code:
<?=countup($site[cron5min]+300)?>
this is what I have up now but you have to refresh the page to see that the time has gone down. I want the javascript to do it live and automatically refresh when it gets to zero because it will restart the countdown. Can anyone help me out?
I will give you a push in the right direction :)

Have a look at these JavaScript object methods:

http://www.w3schools.com/jsref/met_win_setinterval.asp

And this one:

http://www.w3schools.com/jsref/met_loc_reload.asp

You should be able to figure it out now :)

Or are you using AJAX with a framework to call a PHP file somewhere and in that is the code that renders the "counter" and when that counter reaches zero it should reload ?
__________________
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.
EyeDentify is offline  
Reply With Quote
Old 09-07-2010, 11:41 AM   #3 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 24
Thanks: 13
sidisinsane is on a distinguished road
Default

I have a countdown demo at http://sidisinsane.com/playground/css-countdown/ that uses only PHP. There's a link at the bottom to view the code.
sidisinsane is offline  
Reply With Quote
Old 09-07-2010, 04:42 PM   #4 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

The jQuery Countdown plugin by Keith Wood is by far my favorite countdown script. I've used it on many sites and it's always been easily adaptable to suit my needs.
__________________
uʍop ǝpısdn sı ɹǝʇndɯoɔ ɹnoʎ sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
delayedinsanity is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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
Can't get PHP 5. to work? Newbie windows PHP guy DotNetTim Absolute Beginners 11 02-01-2013 11:02 AM
PHP Timer russellharrower Advanced PHP Programming 4 09-14-2009 03:57 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
Next class project? allworknoplay The Lounge 6 04-18-2009 08:33 PM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM


All times are GMT. The time now is 09:32 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design