Now we will write PHP Script to add the current date and time in the database and it will automatically run as per the cron job interval. Now, we create a php file named script. When the cron job runs at that time the current date and time will be inserted into the datatable.
So that means the cron job is running according to the interval. Tags: Setup. April 7, February 4, May 5, January 27, January 20, December 22, Your email address will not be published.
Add me to your newsletter! Skip to content PHP 10, If you want to set custom time then follow the below cron job format. But if we just erase the query it works fine. Do you guys know any code which makes this link work in cron job? You might want to look at not exposing your cron scripts to the internet - move them to outside your web directory because if someone finds it they can constantly reload it to spam your cron scripts i.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 9 months ago. Active 8 years, 3 months ago. Viewed 54k times. Improve this question. Kate Gregory What does "put some query" mean? Also, what did you put as the command for the cron-job? Add a comment. Active Oldest Votes. Cron runs commands as they would be ran via the shell, so running PHP would use local paths.
Improve this answer. This isn't foolproof though and your safest bet is to simply have the cron script outside your web directory. Sign up or log in Sign up using Google.
0コメント