Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
Anders.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/11/07, Anders Norrbring [EMAIL PROTECTED] wrote:
Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
Anders
maybe not the best, but works for linux:
?php
if(isset($_SERVER['SHELL'])) {
echo 'cli script' . PHP_EOL;
} else {
On 10/11/07, Marcus Mueller [EMAIL PROTECTED] wrote:
Anders Norrbring wrote:
Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
Check out http://www.php.net/manual/en/function.php-sapi-name.php.
much better:)
php echo
Anders Norrbring wrote:
Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
Check out http://www.php.net/manual/en/function.php-sapi-name.php.
Greetings
m.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Thu, 2007-10-11 at 19:58 +0200, Anders Norrbring wrote:
Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
I've always used
if( isset( $_SERVER['SERVER_PORT'] ) )
{
return 'web';
}
Cheers,
Rob.
--
Nathan Nobbe skrev:
On 10/11/07, *Marcus Mueller* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Anders Norrbring wrote:
Is there a good way to detect in a script if it's called locally from
command line, or via a remote browser?
Check out
6 matches
Mail list logo