Jump to content

[SOLVED] Display a ticker on a website...


savagenoob

Recommended Posts

I have little knowledge on AJAX but maybe have a use for it but want to make sure its possible. I am integrating a Timecard system on the site Im building and was wondering how easy/hard/possible it would be for AJAX to look at the last clock in on the database and display a count in hours and minutes of how long the employee has been clocked in/out. If it would be fairly easy/possible... please point in the right direction. Thank you.

Link to comment
https://forums.phpfreaks.com/topic/141018-solved-display-a-ticker-on-a-website/
Share on other sites

That should be fairly easy.  A couple AJAX tutorials and you should be fine.

 

 

Hints:

 

 

-Use setTimeout to call a function every second to increment the timer after getting the initial value from PHP.

-Return the seconds from PHP.  IE, instead of 3 hours, 10 minutes, 32 seconds, return 11432.  That will be easier to handle in JS.

-Use the function called by setTimeout to parse the seconds into human-usable format.

 

 

As for AJAX tutorials, just google "AJAX tutorials."  I would stick with well known sites though, like w3schools, or else you might come across some horrible coding.  I have a couple issues with the w3schools tutorial, but it should work fine.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.