![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2004
Posts: 4
Rep Power: 0
![]() |
Hi,
I'm making a text based online game, and I need to make a timer that does something every 60 min. I have 2 questions: 1) Is it possible to make a countdown that resets after every "run" and restarts 2) To make a PHP script for this, will I need to keep a browser window with this script open on the server 24/7? Thanks, Nick |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
Depends what you want to do every 60 seconds. If you want to do somthing on the client side of things, you'd probally want to do it with java, since with php you'll have to keep refresing the browser window. However, server side, you might be able to do it with a script in c++ or (if your using linux) a bash script. Doing this in php probally isn't the best way to do it. Can you provide more info on what your trying to do ever 60 seconds?
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
Youd have to drop a timestamp for each user into a MySQL or into a file and everytime the browser page is refreshed check it against a new timestamp to calc the number of executions of that action you "owe" the user then create a new timestamp to put in its place for the next time.
__________________
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0
![]() |
I made a small PHP prog that did that it work ok but wasnt very practical
__________________
Don't wound what you can't kill |
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
Well unless you want to get into C++ then i would suggest that as the best option.
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|