SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2013
    0 Post(s)
    0 Thread(s)

    How to add value based on 24 hours passing on server?

    Say I have a number, like 10,000. I want to add a value, say 6, every 24 hours. The site is basically keeping a running count of a product & they make 6 every day. I really have no idea how to tackle this as far as adding a value of 6 every 24 server hours.
    Thanks for any help.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Sydney, NSW, Australia
    25 Post(s)
    1 Thread(s)
    This is best done on the server. JavaScript starts over each time the page loads and so would only be able to do the update if someone were to keep the page open for over 24 hours.
    Stephen J Chapman, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts