PHP on IIS
- From: mwagoner@xxxxxxxxxxxxxx
- Date: 31 May 2006 10:39:55 -0700
I installed PHP on a IIS 5.0 sever, using the PHP installer from
php.net. Then I moved our PHP site over to the IIS server but now I am
getting the following errors:
Undefined variable: HTTP_USER_AGENT in
c:\Inetpub\wwwroot\www\browser_detection.php on line 9
here is the browser detection code (which worked fine on the server it
is currently hosted on but I need to move it to a IIS server).
<?php
// Release variables
unset ($BROWSER_AGENT);
unset ($BROWSER_VER);
unset ($BROWSER_PLATFORM);
if (ereg( 'MSIE ([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version)) {
$BROWSER_VER=$log_version[1];
$BROWSER_AGENT='IE';
}
elseif (ereg(
'Mozilla/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version)) {
$BROWSER_VER=$log_version[1];
$BROWSER_AGENT='NETSCAPE';
}
if (strstr($HTTP_USER_AGENT,'Win')) { $BROWSER_PLATFORM='Win'; }
else if (strstr($HTTP_USER_AGENT,'Mac')) { $BROWSER_PLATFORM='Mac'; }
//debug code
//echo ("<br>$BROWSER_PLATFORM: $BROWSER_AGENT - $BROWSER_VER");
// Disable error message when a variable is not predeclared (on
CalDrywall's IIS server)
error_reporting(E_ALL ^ E_NOTICE);
?>
thanks
.
- Follow-Ups:
- Re: PHP on IIS
- From: DonO
- Re: PHP on IIS
- Prev by Date: Re: Excel export problem
- Next by Date: Image resize problems
- Previous by thread: Which array declaration is better?
- Next by thread: Re: PHP on IIS
- Index(es):
Relevant Pages
|