$today = mktime(date('g')+5,date('i')+30,date('s'));                 
				$today=date("M j Y g:i a",$today);
				echo $today;

When i am refreshing page only that time i got the correct value of time...
so i want to show time i.e. continuously updated time on page without refresh page..

How to do that???

9 Years
Discussion Span
Last Post by cwarn23

Live client side streaming with php... I wish.

Since this sort of question keeps appearing, I shall explain.
Php is only able to compile SERVER side code and can only send to the browser or user html, javascript, or css code. Other than that you would need to switch to a client side language like Flash, Ajax or Java which have nothing to do with php.

So when using php, since your final result is expected to be html, Javascript or Css script, it means you need to choose one of those 3 languages to display or continue processing after page has fully loaded. So in your case, you would need to use Javascript unless you want to switch to a non-php related client side script (Ajax, Java or Flash) then Ajax, Java and Flash can do the same thing as Ajax, Java and Flash are design to have simular abilities to php.

If you choose Javascript, there is a free clock provided at the below link which you can fiddle with.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.