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

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

[PHP] how to recognize local or server execution?

2001-10-26 Thread John A. Grant
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; That means stdout from the server and the xxx.html file both

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; That

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 runs

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 execution

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

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

2001-10-26 Thread Frewuill Rodriguez
: 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 and code being run in a browser? - and the Million dollar question, sorry

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 common

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

2001-10-26 Thread DL Neil
] To: Mark [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] 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