stop standard output in cron jobs
| From: | bill | Date: | Tue, 25 Sep 2001 21:15:43 +0000 |
| Subject: | stop standard output in cron jobs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-68778@lists.php.net to get a copy of this message | ||
How can I have a script output nothing?
I have a script that could be called as an html page or as a cgi script
in a cron job.
I put
ob_start();
at the beginning, and at the end put:
if ($argv[1]) {
// accessed as cgi via cron
ob_end_clean();
} else {
// normal access
ob_end_flush();
}
Yet, when run as a cron job, it still outputs two lines:
X-Powered-By: PHP/4.0.6
Content-type: text/html
And so sends the resultant e-mail. Can I make it output nothing when
run as a cron job?
kind regards,
bill hollett