Re: PHP on IIS



I was definitely using 4. That worked, thanks again!


DonO wrote:
What version number were you running before? After I think it's v.4.1
the scoping of variables changed from things like...

$HTTP_POST_VARS["variable_name"] to $_POST["variable_name'].

See if $_SERVER["HTTP_USER_AGENT"] works for you.

Cheers,
D.

mwagoner@xxxxxxxxxxxxxx wrote:
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

  • PHP on IIS
    ... I installed PHP on a IIS 5.0 sever, ... Then I moved our PHP site over to the IIS server but now I am ... unset; ...
    (php.general)
  • 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; ... // Disable error message when a variable is not predeclared (on ...
    (php.general)
  • [waraxe-2004-SA#016 - Cross-Site Scripting aka XSS in phpnuke 6.x-7.2 part 3]
    ... Php-Nuke is popular freeware content management system, ... Here I am, on the road again, discussing about potential XSS case in phpnuke. ... exploded to array $cookie. ... unset -- Unset a given variable ...
    (Bugtraq)
  • 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)