Also -
see:
http://www.php.net/manual/en/function.php-uname.php
- it's a PHP4 function.
Alternatively, you could check the $SERVER_SOFTWARE (or
$HTTP_SERVER_VARS['SERVER_SOFTWARE'], depending on your config)
variable; you'd have to parse the OS out of the returned string,
though.
- steve
At 4:59 PM +0200 8/16/01, Alexander Wagner <[EMAIL PROTECTED]> wrote:
>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
>
>Just do a phpinfo(). There should be an environment-variable you should
>be able to use. The safest way to retrieve them ist getenv().
>
>getenv('SAPI') perhaps?
>
>> if (the OS is Windows) {
>> $siteurl = "http:// www.website.com/ ";
>> $mysqlpasswordfilelocation = " ... outsideroot.txt ";
>> }else{
>> $siteurl = "http://127.0.0.1/";
>> $mysqlpasswordfilelocation = " ...outsideroot.txt ";
>> }
>
>You could also use a config-file. This way, you could run your scripts
>on more than two sites.
>
>regards
>Wagner
>
>PS: My PC is running UNIX.
>
>--
>Madness takes its toll. Please have exact change.
>
--
+------------------------ Open source questions? ------------------------+
| Steve Edberg University of California, Davis |
| [EMAIL PROTECTED] Computer Consultant |
| http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |
+----------- http://pgfsun.ucdavis.edu/open-source-tools.html -----------+
--
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]