Re: Newbie Question: how to refresh a tag and not the whole page (e.g: clock)
| From: | Lars Torben Wilson | Date: | Thu, 19 Oct 2000 18:58:34 +0000 |
| Subject: | Re: Newbie Question: how to refresh a tag and not the whole page (e.g: clock) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21237@lists.php.net to get a copy of this message | ||
Calagan writes:
> Hi Folks,
>
> I put the following tag to display the time on my website:
> <? print(strftime("%I:%M %p")); ?>
> It works great, as long as you don't stick there too long and realize the
> time doesn't change, LOL.
> Now I would like this tag to be refreshed every minutes without reloading
> the whole page since it would look ugly. Can anyone help me do that?
>
> Thanks In Advance,
>
> Calagan
That's not how PHP works--it's completely server-side, meaning that it
more or less just outputs a bunch of text which is then sent to to the
browser--by the time it'd be time for the clock to update, PHP would
already have finished running for that page. You could probably work
up some weird kludge to do this, but it's really the sort of thing
for which you'd typically want to use Javascript.
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+