I have recently written a number of scripts to run from an intranet
that generate reports written to CSV and XLS files that can be downloaded.
I have extended these scripts to zip and email the reports to personnel.
I am now trying to automate the scripts by calling them from Windows Scheduled Task using such CLI
Expand|Select|Wrap|Line Numbers
- C:\apache\xampp\php\php.exe "C:\apache\xampp\htdocs\intranet\programs\Reports\interCoy\intercoyEntry.php"
[PHP]require_once '../Includes/includeFiles.php';[/PHP] I think because the script called is not the current working directory from a CLI.
And this doesn't seem to work either [PHP]$root = $_SERVER['DOCUMENT_ROOT'].'/';[/PHP] The scripts must still work in a browser as well as a CLI.
What is a tidy way to handle the two problems