I am interested in having a “live clock” on my webpage, so it goes automatically. Like a digital clock. Don’t have any idea how to do this, but I guess it includes something with “date” function in PHP…hope anyone have any clues out there.
PHP is a server-side scripting language. You need to use something like javascript to have a client-side clock. You can find loads of examples at places like hotscripts.
Thx thx ppl. It helped. Seemed like I had to use Javascript instead of PHP. But What if you keep on refreshing, lets say an iframe all the time with a PHP echo date function in it? Wouldn’t that work?
That would be a waste of resouces, and as cyborg from dh stated, javascript will keep an accurate time on the webpage, as it runs off of the users computer. Using php for this wouldn’t be effective at all, and would just run up your bandwidth enormously.