0

I am attempting to get data from MySQL and render it using Google charts via Javascript, get a base64 encoded image that i AJAX post to anotehr PHP script to save. This works fine.

My problem is I need this to run as a cron job to generate the chart once per week. When the cron runs the JS does not execute because it is not in the browser. I need a suggestion on how to handle this issue.

Thomas C
  • 75
  • 1
  • 1
  • 5

1 Answers1

0

There few options:

  1. Use this extension http://php.net/manual/en/v8js.examples.php and run js code in PHP.
  2. Use some tool that runs a headless browser that does a request to PHP server. Pick one from the list https://github.com/dhamaniasad/HeadlessBrowsers. Use cron to run that tool
E_p
  • 3,136
  • 16
  • 28