Re: Unix vs PC test for server

From: Date: Thu, 16 Aug 2001 15:06:36 +0000
Subject: Re: Unix vs PC test for server
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-63033@lists.php.net to get a copy of this message
On Thu, Aug 16, 2001 at 09:57:20PM +0700, Paul S. wrote: > I design a website on a PC, and upload it to UNIX. Of course, there are > always one or two variables that I have to keep track of as to > whetherteh server is UNIX or PC. There MUST be a simple way to test > > if (the OS is Windows) { > $siteurl = "http:// www.website.com/ "; > $mysqlpasswordfilelocation = " ... outsideroot.txt "; > }else{ > $siteurl = "http://127.0.0.1/"; > $mysqlpasswordfilelocation = " ...outsideroot.txt "; > } > > ??? Paul, You could check one of the following variables: $HTTP_SERVER_VARS{"OSTYPE"} $HTTP_SERVER_VARS{"SERVER_NAME"} $HTTP_SERVER_VARS{"SERVER_ADDR"} $HTTP_SERVER_VARS{"HTTP_HOST"} or $HTTP_SERVER_VARS{"DOCUMENT_ROOT"} Check phpinfo(), it gives some really usefull info. -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#63033) next »