Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 15th, 2004, 12:16 PM   #1
nickk
Newbie
 
Join Date: Oct 2004
Posts: 4
Rep Power: 0 nickk is on a distinguished road
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
nickk is offline   Reply With Quote
Old Nov 15th, 2004, 3:16 PM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
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!
Pizentios is offline   Reply With Quote
Old Nov 15th, 2004, 3:19 PM   #3
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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.
__________________

tempest is offline   Reply With Quote
Old Nov 15th, 2004, 4:07 PM   #4
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
I made a small PHP prog that did that it work ok but wasnt very practical
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Old Nov 15th, 2004, 5:20 PM   #5
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Well unless you want to get into C++ then i would suggest that as the best option.
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC