Portal Home > Knowledgebase > Articles Database > Time in animation in php
Time in animation in php
Posted by mohammadi, 01-03-2011, 08:14 AM |
Hello
I need to show time while its second is increasing every second without refreshing the page.
Would you please help me?
|
Posted by praveenkv1988, 01-03-2011, 12:54 PM |
You have to send ajax request every second to get the time from the server. But I dont think the ajax request will be completed within a second in internet.
|
Posted by Steve_Arm, 01-03-2011, 01:39 PM |
Read here:
http://www.elated.com/articles/creat...ascript-clock/
|
Posted by jhadley, 01-03-2011, 02:51 PM |
Not the case. Only 1 query is needed to get the time, Javascript can then count the seconds after that.
|
Posted by iTom, 01-03-2011, 02:56 PM |
PHP is server side, you need something client side like Ajax to keep it updating
|
Posted by lynxus, 01-03-2011, 03:00 PM |
Agreed AJAX isnt even needed.
If you have a javascript timer and then when teh page is called via php, PHP can output the current time into the javascript.
IE:
time = "";
some javascript increasing time and echoing it.
No ajax needed.
|
Posted by Hoopla-Brad, 01-03-2011, 07:36 PM |
Javascript wouldn't be too hard.
Google "Creating a JavaScript Clock"
|
Posted by mohammadi, 01-04-2011, 02:58 AM |
Thanks a lot Steve_Arm
|
Add to Favourites Print this Article
Also Read
Ioncube ? (Views: 559)