Jump to content


Photo

Make a Date and time script


  • Please log in to reply
4 replies to this topic

#1 justin15

justin15
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 June 2006 - 02:48 PM

I am trying to make a date and time script that will 'refresh' every second, I would like for the just the script to reload, and not the entire page, because if you have a big page, it will take long to keep reloading the page every second.

So, has of now, I have a working script which reloads the page, and does it guick, because its jus tthe plain page. If anyone knows the answer to this SIMPLE guestion, please let me know.

Heres the page itself
[a href=\"http://24.215.127.102/PHP/date.php\" target=\"_blank\"]Click here for the page[/a]

Heres the code
<META HTTP-EQUIV="Refresh"
CONTENT="1; URL=date.php"> 

<?PHP
$today = date("F j, Y, g:i:s A");

echo "<B>Time and Date: $today</B>";


?>


#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 11 June 2006 - 02:55 PM

ajax?
z..z..z..z..z..z..z..z..

#3 justin15

justin15
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 June 2006 - 02:59 PM

What the hell ... lol ... I dont see that having anything to do with my script

#4 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 11 June 2006 - 03:02 PM

no no you need AJAX to do that kind of small update to the page. I suppose it would be like to take the time with php and then in java add 1 second every second an update the area with the date inside it, or else get the time from java itself and not use php at all.
z..z..z..z..z..z..z..z..

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 11 June 2006 - 03:16 PM

[!--quoteo(post=382519:date=Jun 11 2006, 11:02 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 11 2006, 11:02 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
... not use php at all.
[/quote]
Right. That's exactly what javascript 'clocks' are meant to do.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users