Re: $ENV['SCRIPT_FILENAME']

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/14/06, Ryan A <genphp@xxxxxxxxx> 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux