Re: [PHP] how to recognize local or server execution?

2001-10-28 Thread DL Neil
John, Netscape! Differences between servers AND differences between browsers AND differences between in-browser and command-line operations! Isn't life fun? Like you I'm messing around with some of these differences as part of a bid to 'convert' an existing set of scripts from browser i/f to c

Re: [PHP] how to recognize local or server execution?

2001-10-27 Thread John A. Grant
"Dl Neil" <[EMAIL PROTECTED]> wrote in message 0a4e01c15e72$c47db560$a516100a@jrbrown">news:0a4e01c15e72$c47db560$a516100a@jrbrown... > Thanks for the idea. I have just resurrected and had another play with my 'testbench.php', running it from both > IE/Apache and in a DOS box. > > It includes the

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread DL Neil
tains the number of command line parameters passed to the script (if run > on the command line). > > In case you have any parameter > > > > hope this helps... and this should work on windows too. > > - Original Message - > From: "DL Neil" <[EM

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread Mark
On Fri, 26 Oct 2001 23:12:17 +0100, DL Neil wrote: >Mark, >Backing John's question up by one iteration: is there a PHP >environment variable which can be used to >distinguish between code being run from the command line and code >being run in a browser? I guess the best way is to check for a comm

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread Frewuill Rodriguez
TED]> Sent: Friday, October 26, 2001 6:12 PM Subject: Re: [PHP] how to recognize local or server execution? > Mark, > Backing John's question up by one iteration: is there a PHP environment variable which can be used to > distinguish between code being run from the command line a

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread DL Neil
Mark, Backing John's question up by one iteration: is there a PHP environment variable which can be used to distinguish between code being run from the command line and code being run in a browser? - and the Million dollar question, sorry make that the M$ question: will it also work under Windo

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread Jim Lucas
use $GLOBALS[SERVER_ADDR] it will return the IP address of the server. then use that in an if..then..else Jim - Original Message - From: "John A. Grant" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 26, 2001 2:18 PM Subject: [PHP] how to recognize local or server exec

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread Frewuill Rodriguez
Try using apache var $SERVER_SOFTWARE in order to know where you are - Original Message - From: "John A. Grant" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 26, 2001 5:18 PM Subject: [PHP] how to recognize local or server execution? > I have an xxx.php page that run

Re: [PHP] how to recognize local or server execution?

2001-10-26 Thread Mark
On Fri, 26 Oct 2001 17:18:37 -0400, John A. Grant wrote: >I have an xxx.php page that runs on my Unix server. I also >run php.exe on my NT box to generate the corresponding >xxx.html file like this: > c:\> php -q xxx.php > xxx.html > >The xxx.php file contains stuff like this: > print "hello\n"