RE: [PHP] Need best way to determine if cronjob or external browser calledmy script
| From: | Jay Blanchard | Date: | Wed, 19 Jan 2005 13:58:20 +0000 |
| Subject: | RE: [PHP] Need best way to determine if cronjob or external browser calledmy script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-206745@lists.php.net to get a copy of this message | ||
[snip]
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.
[/snip]
COOL!
I am suspecting that there is a question here, and I suspect the
question is "how do I do this?" To see if the browser called it you can
check the $_SERVER array http://us2.php.net/reserved.variables or you
could pass an arguement from the browser that identifies the browser. If
that argument exists the browser has called it, if not, the CRON job has
called it. You could also pass an arguement from the CRON command as
well.