D
D
Dmitry10202020-03-12 18:03:03
PHP
Dmitry1020, 2020-03-12 18:03:03

How to recursively run a php script using cron?

Good afternoon

, there is a script with a stage parameter from 0 to 50.
Depending on the number in the parameter, various actions are performed

through the browser, you can call site.ru/script?stage=0
, the actions of stage 0 will be performed, then the script calls itself, but already ?stage =1 and so on up to 50
now the call is made through javascript, also tried through the header location

in the browser everything works correctly. But I would like to add a task to the task scheduler.
so that the task was one, and the script also worked out all the stages from 0 to 50.

Tell me, please, how can I implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry1020, 2020-03-13
@Dmitry1020

As a result, I solved the problem through file_get_contents.
That is, the first iteration is launched by the task scheduler via wget. And then the script launches itself with an increase in the stage through file_get_contents.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question