PHP on IIS



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

.



Relevant Pages

  • Re: PHP Driven Site responding slow on different networks.
    ... would say there's something in the PHP code. ... Two switches between webserver and Cisco. ... > that my Cisco had an issue or there was some problem in my network, ... > except for the IIS server and I still get the same results. ...
    (comp.lang.php)
  • Re: Installing an configuring PHP
    ... How to I make it go to my IIS server and PHP application and not to ... Windows file associations, which can seen in any explorer window by choosing Tools/Folder Options/File Types. ... While DreamWeaver is a good app, I personally find it to be overkill for editing PHP source code. ...
    (comp.lang.php)
  • Re: PHP on IIS
    ... Then I moved our PHP site over to the IIS server but now I am ... here is the browser detection code (which worked fine on the server it ... unset; ...
    (php.general)
  • Re: Installing an configuring PHP
    ... I also have Dreamweaver installed on my Windows PC. ... I'd like to start writing some simple PHP files. ... There are 4 versions of IIS as choices. ... How to I make it go to my IIS server and PHP application and not to ...
    (comp.lang.php)
  • Re: Failed opening mysql.inc for inclusion (include_path
    ... everything on another fedora core 6 server. ... installed php 5.2.5 and apache 2.0.63 ... I added the following to see if php even thought it could get there: ... I compiled apache with -- ...
    (comp.lang.php)