Log in

View Full Version : how can I schedule a php code



ilovephp
02-10-2010, 12:24 PM
I am developing a sms website, there I want to create a schedule sms system for that I need a php code that receive a command and run in future date directly from background,

I think cronjob can do this but how?? directly from the php code

Please Help me for this, I will be always grateful to you

Schmoopy
02-10-2010, 01:06 PM
You don't make the cron job with PHP, it is an external system.

Some hosts provide it with their control panel, but it depends who you're with.

But setting up a cron job should be fairly straight forward if your host has one. You'll get an option to choose how often you want the script run, and then you just choose which file you want to run.

Check your host's documentation.

ilovephp
02-10-2010, 02:00 PM
My provider supports cronjobs from the control panel, but logically its not possible to create a cronjob every time a user has requested,

So I need any other option to do this job

Schmoopy
02-10-2010, 02:13 PM
I doubt your provider would let you dynamically create a new cron job from your site, but I'm really not sure. Pose them the question and see what they say.

ilovephp
02-10-2010, 06:28 PM
I have the solution now, when anyone send a request for schedule sms, It will be stored to the database and I will run only one php script from cronjob to fetch request from database and send sms. :D