"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 following code: [...]
Thanks (also thanks to the others for the useful comments & ideas). I don't have $HTTP_SERVER_VARS["SERVER_NAME"] or $GLOBALS["SERVER_ADDR"] or $SERVER_SOFTWARE probably because my server is netscape ("nsapi"?). They are all blank. Yes I declared them 'global'. I ended up with these functions which seem to do the trick, at least for my server and NT. function isonserver() { global $PHP_SELF,$argc; return $argc==0 && isset($PHP_SELF) && $PHP_SELF; } function getpagename() { global $PHP_SELF,$argv; return basename(isonserver() ? $PHP_SELF : $argv[0]); } function getlinedelimiter() { return isonserver() ? "\n" : "\r\n"; } The pagename is critical to my site, because the code needs the page name to recognize certain suffixes and 'special page names. Perhaps it is only sufficient to test for $PHP_SELF and not $argc, but I threw in $argc==0 anyway. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]