On Wed, 2005-01-19 at 07:47, Al wrote: > I'm working on a script that can be initiated by a cronjob or from a browser. > > I want the script to act differently depending on which one called it. > > --
I do not know what the definitive answer is but there are a bunch of environment differences. Here is one taken from http://us2.php.net/features.commandline [EMAIL PROTECTED] elevatetest]$ cat testbrowser.php <?php if ($_SERVER['SERVER_PORT']) { echo "SERVER MODE\n"; } else { echo "CLI MODE\n"; } ?> results from wget: [EMAIL PROTECTED] elevatetest]$ wget -q --output-document=- https://localhost/elevatetest/testbrowser.php SERVER MODE [EMAIL PROTECTED] elevatetest]$ results from cli [EMAIL PROTECTED] elevatetest]$ php testbrowser.php Content-type: text/html X-Powered-By: PHP/4.3.6 CLI MODE [EMAIL PROTECTED] elevatetest]$ mozilla returns SERVER MODE HTH Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php