TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-10-2005, 12:39 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
danthethug is on a distinguished road
Default 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...
danthethug is offline  
Reply With Quote
Old 04-10-2005, 12:43 AM   #2 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

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.
CreativeLogic is offline  
Reply With Quote
Old 04-10-2005, 12:45 AM   #3 (permalink)
The Wanderer
 
Join Date: Apr 2005
Location: Missouri, USA
Posts: 15
Thanks: 0
William is on a distinguished road
Default

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.
Send a message via AIM to William Send a message via MSN to William
William is offline  
Reply With Quote
Old 04-10-2005, 01:14 AM   #4 (permalink)
The Visitor
Newcomer 
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
danthethug is on a distinguished road
Default

ok so i put wget (http://www.nukeya.com/updates_for_hour.php)
danthethug is offline  
Reply With Quote
Old 04-10-2005, 01:21 AM   #5 (permalink)
The Wanderer
 
Join Date: Apr 2005
Location: Missouri, USA
Posts: 15
Thanks: 0
William is on a distinguished road
Default

Yeah in crons in your cPanel. :)
Send a message via AIM to William Send a message via MSN to William
William is offline  
Reply With Quote
Old 04-10-2005, 01:22 AM   #6 (permalink)
The Visitor
Newcomer 
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
danthethug is on a distinguished road
Default

ok thanks lol
danthethug is offline  
Reply With Quote
Old 04-10-2005, 03:04 AM   #7 (permalink)
The Visitor
Newcomer 
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
danthethug is on a distinguished road
Default

well i put what you all told me to put but its not working :'(
danthethug is offline  
Reply With Quote
Old 04-10-2005, 03:15 AM   #8 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

I've never done it the way he's telling you to. I'll get you a different way in a little bit.
CreativeLogic is offline  
Reply With Quote
Old 04-10-2005, 11:19 PM   #9 (permalink)
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

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
CreativeLogic is offline  
Reply With Quote
Old 04-11-2005, 01:25 AM   #10 (permalink)
The Wanderer
 
Join Date: Apr 2005
Location: Missouri, USA
Posts: 15
Thanks: 0
William is on a distinguished road
Default

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.
Send a message via AIM to William Send a message via MSN to William
William is offline  
Reply With Quote
Old 04-13-2005, 12:39 PM   #11 (permalink)
The Wanderer
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
ShadowWind is on a distinguished road
Default

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.
ShadowWind is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:02 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design