0

Hi,

I have PHP script which is calculating some Google Maps API functions in Javascript and then sending output back to PHP.

My biggest problem is, that i need it to run at intervals, but AFAIK cron can't handle javascript

I've tried a little workaround - setting cron which sends the url to online web thumbnail generator - and it works. Until this online service denied loading scripts at their side.

It must be some way to achieve this. Maybe running some instance of browser in PHP?

4
Contributors
6
Replies
8
Views
6 Years
Discussion Span
Last Post by palsoft
0

There is no direct/good way. You have to run you code in a browser somehow. Maybe if your server allows, save the output in file and run "firefox file.htm".

Also, in Windows I think you can get your work done using PHP and COM components. But again a lot is dependent upon your host. If you have your own server or have good control, maybe you can get what you want.

-1

You can use cron to call a php page.
IN your crontab file, the command part would be something like this:

/usr/bin/php /users/me/www/myfile.php
0

You can use cron to call a php page.
IN your crontab file, the command part would be something like this:

/usr/bin/php /users/me/www/myfile.php

Cron can not run client-side Javascript...

1

Perhaps a site uptime checking service.

Or if you have a pc running 24/7, open the page in Opera and set it to refresh at your interval.

Votes + Comments
New option for me - uptime checking
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.