Re: $ENV['SCRIPT_FILENAME']

From: Date: Mon, 15 May 2006 15:18:34 +0000
Subject: Re: $ENV['SCRIPT_FILENAME']
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-236210@lists.php.net to get a copy of this message
On 5/14/06, Ryan A <genphp@yahoo.com> wrote:
Anyone have an idea of a variable (eg: $_SERVER['REQUEST_METHOD'] ) that will be set only if called via the web and ignored if called via cli?
I have no experience with CLI, and haven't tested this, but I believe that any time a request comes through a web browser, the $_GET and $_POST values are set, even if they're empty. This may go for the $_COOKIE global as well. So you could simply check if one of these are set: isset($_POST) But again I have no CLI experience, so I could be off. But it's worth testing... HTH, John W

« previous php.general (#236210) next »