Hi all, Well I'm making an php clock, so far so good huh <?php echo "<meta http-equiv='refresh' content='1'>"; echo "<font color='#999999' size='1' face='Verdana, Arial, Helvetica, sans-serif'>"; echo date('G'); echo ":"; echo date('i'); echo ":"; echo date('s'); ?> Well when the seconds change the whole page refreshes, yes i code it this way. Butt when i use this script on my web page, it refresh evrey second and then my visitor counter get's messed up. Some idea's ?? I can't find it how to do it ... Please help me. PS: Sorry for my terrible english.. Greetz, LmS
If you're going to keep requesting the time from the server, at least do it like with ajax or something ... and clocks on sites are hardly ever helpful (the ones that constantly update). And no </font>. And really the font tag isn't meant to be used any more, but that's getting off the topic tbh.
Ajax is probably the best method if you must do it. But I think you really should just use javascript. Imagine the extract traffic with a call every second (and what would happen if you have thousands of visitors on that page at the same time). Really not a good idea!
Tottally true, ajax just in case, you really need it, for example for thinks, where you must do something (for example bettings), for homepage or that kind of page, js is cool. If you want, u can code js, that will get correct time from server (php will generate js) nad than just simulate clock. Soo easy.