TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Cron tabs for turns (http://www.talkphp.com/general/11-cron-tabs-turns.html)

danthethug 04-10-2005 12:39 AM

Cron tabs for turns
 
ok guys ive coded in php lots of times just never figured out how to work with crons im trying to make turns on my game but i have it running thru a file and i dont like having to click it every 59 minutes lol is there a function to call that will execute this file without it popping up so it executes every 59 mins whether the user is logged in or can someone help me on the crons...

CreativeLogic 04-10-2005 12:43 AM

Well this all depends on what you're php files is attempting to do. If you have to have a session with the user's information, then you will have to include a file executing php code every minute. Otherwise, what would be best would be to create a cron tab as long as you have permission to use it on your host. The cron tab would call the file specified automatically.

William 04-10-2005 12:45 AM

If you have cPanel it's really simple to add a cron... You could use just wget (url-to-file) wich downloads the file making it exicute now of coarse that cops its self in the directory 10billion times lol but.... it gets job done.

danthethug 04-10-2005 01:14 AM

ok so i put wget (http://www.nukeya.com/updates_for_hour.php)

William 04-10-2005 01:21 AM

Yeah in crons in your cPanel. :)

danthethug 04-10-2005 01:22 AM

ok thanks lol

danthethug 04-10-2005 03:04 AM

well i put what you all told me to put but its not working :'(

CreativeLogic 04-10-2005 03:15 AM

I've never done it the way he's telling you to. I'll get you a different way in a little bit.

CreativeLogic 04-10-2005 11:19 PM

I did a little bit more research. The wget command is a unix command (obviously), so you don't need the parentheses. Try removing those with your same setup.
wget http://www.nukeya.com/updates_for_hour.php

William 04-11-2005 01:25 AM

Yes, wget is a unix command and it downloads a file and puts it in the directory you are when you enter that command. It is a way to put files on your server you can say. Now the command is exicuted on the box in your /home/user/ directory. Wich is what is before your /www/ and /public_html/ files on your cPanel account. So when it downloads the file it exicutes command. Crons execute commands in linux at a certian time.

ShadowWind 04-13-2005 12:39 PM

Make sure also that your PHP file is running clean (IE no errors). Errors will make the cron task fail in some cases. Had a bit of problem installing a news feed mod due to that.


All times are GMT. The time now is 04:41 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0