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 02-10-2008, 09:08 PM   #1 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default Running a program in real time?

How would I run a program in real time? Like... X seconds away from whenever. or months... And then be able to cancel that time, and add a new one.

Like, execute a function a day from now, but later on tonight I submit a form that says execute it 3 days from now...
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 02-10-2008, 09:10 PM   #2 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Use cron jobs?
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 02-10-2008, 09:38 PM   #3 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Not all cron jobs are the same is what I heard. Next to that, I don't even know how to activate them in DirectAdmin or Plesk. Got some intel on that xenon?
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 02-10-2008, 10:47 PM   #4 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

How would I use cron jobs from a PHP script? Is it reliable to use when managing important things?
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 02-11-2008, 02:22 AM   #5 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Quote:
Originally Posted by Aaron View Post
How would I use cron jobs from a PHP script? Is it reliable to use when managing important things?
You don't "use them from PHP'. You program the system to run some PHP scripts (e.g.: system commands) at a specified time. That's all. You can schedule a single run, a one day/week delayed task, or an hourly task. It's up to you.

Respawn: sorry, I have no clue.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 02-11-2008, 01:55 PM   #6 (permalink)
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Default

You can use cron jobs to call php scripts Aaron, there's normally a button in Plesk for setting up cron jobs, just search under the domain you're managing.
__________________
Pro. Geek
http://www.mikeholloway.co.uk
flyingbuddha is offline  
Reply With Quote
Old 02-12-2008, 11:29 PM   #7 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

Then Cron Jobs is useless to me
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 02-12-2008, 11:35 PM   #8 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I dont see how it is useless to you, cron seems to be exactly what you are looking for.
__________________

Village Idiot is offline  
Reply With Quote
Old 02-13-2008, 08:42 PM   #9 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 166
Thanks: 0
wGEric is on a distinguished road
Default

From your first post a cron job is what you want. You can write a psuedo cron script in PHP but it won't be as reliable as a cron job since someone has to hit the page in order for it to execute.
__________________
Eric
wGEric is offline  
Reply With Quote
Old 02-13-2008, 10:03 PM   #10 (permalink)
The Contributor
 
Devels's Avatar
 
Join Date: Nov 2007
Posts: 27
Thanks: 2
Devels is on a distinguished road
Default

If you don't have a webadministrator tool, but SSH acces to your host, then you can use the crontab command to configure running commands or php scripts at regular intervals.
Devels is offline  
Reply With Quote
Old 02-14-2008, 03:39 AM   #11 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

this is not hard to fix,
make a batch file and you can like make a php script to excute the batch file,
or even if you want it at a time in cmd u can do as some one said here. put a time on when to start that php script,

and when to start other script or end it...

Google, is good :) ;)

Google -> batch edit + time + php so on...

;)
codefreek 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 01:58 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