Jump to content


Photo

Visible Countdown


  • Please log in to reply
2 replies to this topic

#1 ale_jrb

ale_jrb
  • Members
  • PipPip
  • Member
  • 17 posts
  • LocationLondon, UK

Posted 27 May 2006 - 06:58 PM

Hi.

I need to code a timer but I am unsure how I should go about doing so.

It needs to work in such a way that a user can click a link which will start a timer. The timer will then start counting down. It must be able to change without the user having to refresh the page. Also, the user must be able to close the page or destroy their log in section and it must carry on counting. When it reaches the end it activates something.

Does anyone know how I could manage this? Thanks very much!

:)


#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 27 May 2006 - 07:07 PM

well if you have a timestamp column and a timelength column in a database, when the user clicks on start, it can send the current timestamp to the database, as well as the length of time you want the timer to be.

then you would have a script that gets the information from the database. then you would use ajax and javascript to continually call the script and retrieve the information and display it.

if the user closes the browser.. well the timestamp is in the database, along with the length.

if the user goes to the countdown page, it will continue to pull the original timestamp and timelength from the database and show the countdown accordingly. all the while, the script would check to see if the current time stamp is greater than the original timestamp + the timelength. if it is, then do the event.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 ale_jrb

ale_jrb
  • Members
  • PipPip
  • Member
  • 17 posts
  • LocationLondon, UK

Posted 28 May 2006 - 10:45 AM

Ooh... OK, thanks. Now to find out how to call a script with Javascript... :)

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users