I was looking for a php script that will get executed every hour ( without executing it ) ( ex. for sending emails ) but i don't know, the way it works. Do i have to use Cron Jobs or is there anything in php to make such kind of scripts?
Thank you
PHP does not have anything like this included. You have to use an external tool, such as cron, to run a PHP script perdiodically.
If you are not allowed to set cron jobs on your web hosting, there exist websites that will call one URL periodically, like http://www.onlinecronjobs.com/.
You need to use cron jobs if you want it to run on a set schedule.
Yes, if you are using linux, go to the terminal and type crontab -e.
Your line will be something like that
1 2 3 4 5 (this line here is just an information.. dont type it on crontab)
00 * * * * wget www.page.com/yourphp.php
So the script will run 1 00 On minute 00 2 * Every hour 3 * Every day 4 * Every month 5 * Every day of the week
Then type :wq to close So its done.
You need to have the crontab and the wget in this scenario.