Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

95 users online



Automated PHP script execution?

Automated PHP script execution?

Currently viewing this thread: 1 (0 members and 1 guests)


marf

marf

Marf
Status: Offline!

Automated PHP script execution?

I am currently designing a text based game just for fun. Every night at midnight I want all characters "energy" reset back to 10/10. So if they used it up the day before it will be back. I can easily write a PHP script to do that to the mySQL database, but the question is how do I execute a script like that every night at 12:00. My test server runs linux, is there a way to do it on linux?

Thanks for your help in advance.

Marf

___________________

http://www.infinitedesigns.org/signature.jpg

Stevie

Stevie

Neversidian
Status: Offline!

Run a cron job.

http://www.adminschoice.com/docs/crontab.htm

___________________

"Hey, **** YOU!"

Alekz

Alekz

So what's up :)
Status: Offline!

Or just check time every time they play, if it's past midnight refill energy and if it's not then leave it the way it is. They can't see their energy if they don't run the script Wink

___________________

"¿Por qué buscais la felicidad, oh, mortales, fuera de vosotros mismos?"
~Boecio

System_Failure

System_Failure

Status: Offline!

somehow, cronjobs dont like me...I can never do them right =/

___________________

xXxXxXx

phpmonkey

phpmonkey

whoa, wtf?
Status: Offline!
Quote:

Originally posted by Alekz
Or just check time every time they play, if it's past midnight refill energy and if it's not then leave it the way it is. They can't see their energy if they don't run the script Wink

Inefficient on a popular site.

___________________

Fomerly known as lasnaranjas. Holler.
http://card.mygamercard.net/gelsig/blackdood.png

marf

marf

Marf
Status: Offline!

ok then

0 0 * * * /path/to/php/cgi /path/to/php/file.php

would be the cron script

But now I think I might want the script to execute once every 30 minutes. How would I do that instead?

___________________

http://www.infinitedesigns.org/signature.jpg

PaparazziX

PaparazziX

Status: Offline!

30 0

___________________

http://sf.calzinger.net/image.png

marf

marf

Marf
Status: Offline!

That would just make it do it at 12:30 midnight every night.

___________________

http://www.infinitedesigns.org/signature.jpg

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0083 seconds.