?
Solved

PHP .htaccess problem with IE7 and 8

Posted on 2009-02-15
4
Medium Priority
?
2,040 Views
Last Modified: 2013-11-15
Hi there
I am looking for some help with a problem, I have a very simple form on a webpage for a users name and password. Tthe form then goes to the small PHP script and then opens up the membership webpage.  This all works fine in FireFox, Crome, Opera and Safari but IE7 and IE8 just fail to work and I get an error page.  I think the problem is in line four of the PHP code, but I cannot fine a fix for it, can anyone help please?

Thank you for reading this post.

PHP Code
<?php 
$user=$_REQUEST['user']; 
$pass=$_REQUEST['pass']; 
header("Location: http://".$user.":".$pass."@www.mysite.co.uk/clients"); 
exit; 
?> 
 
On page form 
<!-- code starts here --> 
<form action="http://www.mysite.co.uk/login.php" method="post" id="thisform"> 
<fieldset> 
<p><label for="Username">Username:</label> <input type="text" name="user"></p> 
<p><label for="Password">Password:</label> <input type="password" name="pass"></p> 
<p><input type="submit" value="Login"></p> 
</fieldset> 
</form>

Open in new window

0
Comment
Question by:Jakibrown
  • 2
4 Comments
 

Author Comment

by:Jakibrown
ID: 23650507
I have discovered reading numerous web sites that Microsoft put in a fix to IE7 and IE8 which prevents "Location" from working within a PHP script. Where I think the code problem is is within this line of code below:

What I am looking to do is have a standard web page which contains a login and password which will then send  the information through to the .htaccess and .htpasswd files. This will stop username and password popup. The code in my original posting works perfectly in 4 other browsers: FF, Chrome, Opera and Safari.

If someone could help I would be extremely grateful.

We do not want to go down the route of MySQL because of the cost involved in maintaining a database with the internet provider that we are with.


header("Location: http://".$user.":".$pass."@www.mysite.co.uk/clients"); 

Open in new window

0
 
LVL 1

Accepted Solution

by:
drfresh earned 2000 total points
ID: 23655640
Microsoft changed their support for usernames and passwords in a URL with a security patch.  There are a few workarounds, however.  This example uses the XMLHTTP workaround to pre-authenticate, and then redirect the browser to the desired URL.
<?php
$user=$_REQUEST['user'];
$pass=$_REQUEST['pass'];
$url="http://".$user.":".$pass."@www.mysite.co.uk/clients";
echo '<html>';
echo '<head>';
?>
 
<TITLE>Interim Redirect Page</TITLE>
 
<script language="Javascript">
function DoIt() {
 
if ( window.ActiveXObject ) {
    // IE
	RedirectBrowser("<? echo $url; ?>");
}
else {
  // Firefox
  document.location="<? echo $url; ?>";
  
  
}
 
 
}
 
</SCRIPT>
 
 
 
 
 
<SCRIPT Language="JavaScript" RUNAT="Client">
 
 
	/*_____________________________________________________
 
	Name:		GetUrlWithCreds()
	Purpose:	retrieve a URL from a specified location
	            which is returned from a server in a header
	            value called "Redirect-Location"
	Param(in):  none
	_______________________________________________________
    */
	function GetUrlWithCreds() { 
		//store the URL for the resource that will return the URL that includes the Basic auth credentials below:
		sURL = "http://ServerA.q837104.info/SomePath/PageOfInterest.asp";
		//create the XMLHTTP object to retrieve the URL that has embedded creds
		oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
		oXMLHttp.Open("GET", sURL, false);
		oXMLHttp.Send();
		if ( oXMLHttp.status == 200) {
			sURLwCreds = oXMLHttp.getResponseHeader("Redirect-Location");
		}
		else {
			sURLwCreds = "Error = redirect not received from:\n\t" + sURL;
			alert(sURLwCreds + "\nstatus code = " + oXMLHttp.status);
		}
		oXMLHttp = null;
		RedirectBrowser(sURLwCreds);
    }
    
    
	/*_____________________________________________________
 
	Name:		LoadPage()
	Purpose:	sets the location of the current window
	            to be the URL passed to this function
	Param(in):  UrlToReload - a valid URL
	_______________________________________________________
    */
    function LoadPage(UrlToReload) {
    	window.location.href=UrlToReload;
    }
    
    
	/*_____________________________________________________
 
	Name:		RedirectBrowser()
	Purpose:	sets the location of the current window
	            to be the URL passed to this function
	Param(in):  sUrlwCreds - a URL with credentials 
	                         embedded between the protocol
	                         and host sections
	_______________________________________________________
    */    
    function RedirectBrowser(sUrlwCreds) {
    	aCurrentUrl = new ParseURL(sUrlwCreds);
		for (i = 1 ; i < aCurrentUrl.length ; i++) {
			if (aCurrentUrl[i] == null) {
				aCurrentUrl[i] = "";
			}
		}
		sURLwoCreds = aCurrentUrl[1] + "://" + aCurrentUrl[4];
		if (aCurrentUrl[5].length > 1) {
			sURLwoCreds += ":" + aCurrentUrl[5];
		}
		sURLwoCreds += aCurrentUrl[6] + aCurrentUrl[7]; 
		if (aCurrentUrl[8].length > 1) {
			sURLwoCreds += "?" + aCurrentUrl[8];
		}
		if (aCurrentUrl[9].length > 1) {
			sURLwoCreds += "#" + aCurrentUrl[9];
		}
		oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
		try {
			oXMLHttp.Open("GET", sURLwoCreds, false, aCurrentUrl[2], aCurrentUrl[3]);
			oXMLHttp.Send();
			if ( oXMLHttp.status == 200 ) {
				//if all goes well, WinInet should now be authenticated on destination site so
				//   setting the current window's URL to that site will not prompt for credentials
				LoadPage(sURLwoCreds);
			}
			else {
				alert("Error - an unexepected status code was returned: " + oXMLHttp.status);
			}
		}
		catch(ex) {
			document.body.innerHTML = ErrorGenerator(ex);
		}
    }
 
 
	/*_____________________________________________________
 
	Name:		GetCLSID()
	Purpose:	retrieve a CLSID for a registered component
	Parameter:  sProgID - string that is a ProgID for a
	                      given registered component on
	                      the local computer.
	_______________________________________________________
    */
    function GetCLSID(sProgID) {
		try {
			var oWshShell = new ActiveXObject("WScript.Shell");
			return oWshShell.RegRead("HKCR\\" + sProgID + "\\CLSID\\");
		}
		catch(ex) {
			return "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table><BR><BR>unable to read registry using WshShell.RegRead";
		}
	}
	
	
	/*______________________________________________________
 
	Name:		GetInProcServer32()
	Purpose:	retrieve a DLL path for a registered 
	            component
	parameter:  sCLSID - string that is a CLSID for a
	                     given registered component on 
	                     the local computer.
    _______________________________________________________
    */
    function GetInProcServer32(sCLSID) {
		try {
			var oWshShell = new ActiveXObject("WScript.Shell");
			return oWshShell.RegRead("HKCR\\CLSID\\" + sCLSID + "\\InProcServer32\\");
		}
		catch(ex) {
			return "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table><BR><BR>unable to read registry using WshShell.RegRead";
		}
	}
 
 
	/*______________________________________________________
 
	Name:		GetVersion()
	Purpose:	Retrieve file version from PE header
	Parameter:	none
	
	NOTE: a description of the RegExp object used in 
	      this function is provided below:
      		the following Regular Expression:
			    (?:(%(.*?)%))(?:(\\(?:[^\?]*?\\)*)([^\?]*?)$)
			will seperate the string:
			    %SystemRoot%\System32\Inetsrv\w3core.dll
			into the following array elements (all strings):
		       array[0] = %SystemRoot%\System32\Inetsrv\w3core.dll
		       array[1] = %SystemRoot%
		       array[2] = SystemRoot
		       array[3] = \System32\Inetsrv\
		       array[4] = w3core.dll
    _______________________________________________________
    */
	function GetVersion() {
		var sSysPath = "";
		//generate the Path to the DLL being used to call XMLHTTP
		try {
			sXmlDllPath = GetInProcServer32(GetCLSID("Microsoft.XMLHTTP"));
			RegExp = /(?:(%(.*?)%))(?:(\\(?:[^\?]*?\\)*)([^\?]*?)$)/;
			if ( RegExp.test(sXmlDllPath) ) {
				arDllPath = RegExp.exec(sXmlDllPath);
				var oWSH;
				oWSH = new ActiveXObject("WScript.Shell");
				sSysPath = oWSH.Environment("PROCESS").Item(arDllPath[2]) + arDllPath[3] + arDllPath[4];
			}
			else {
				sSysPath = sXmlDllPath;
			}
		} 
		catch(e) {
			//return e.number + " - " + e.description + "\n\nWScript.Shell is needed to get DLL versions";
			document.body.innerHTML = ErrorGenerator(e);
		}
		// get the version of the file
		try {
			var oFSO;
			oFSO = new ActiveXObject("Scripting.FileSystemObject");
			arrReturned = new Array(2);
			arrReturned[0] = arDllPath[4];
			arrReturned[1] = oFSO.getFileVersion(sSysPath);
			return arrReturned;
		}
		catch(e) {
			//return e.number + " - " + e.description + "\n\nScripting.FileSystemObject is needed to get DLL versions";
			document.body.innerHTML = ErrorGenerator(e);
		}
	}
	
	
	/*_____________________________________________________
 
	Name:		ParseURL()
	Purpose:	Retrieve file version from PE header
	Parameter:	sURL: string that has is a URL in the
	            format specified in the details section
	            below.
    Return:     Array with URL parts
	                
    This function uses JavaScript's regular expression object to parse the
    URL passed to it, and return the parts of the URL in array elements.
 
      --------------------------------------------------------------------
      NOTE: URL canonicalization is a non-trivial task and this simplified 
            sample does not account for URL escaping or encoding where the
            address http://www.microsoft.com/security/ is equivalent to the
            address http%3A%2F%2Fwww%2Emicrosoft%2Ecom%2Fsecurity%2F 
      --------------------------------------------------------------------
 
    The proper format of the URL that should be passed to this function is:
		
      protocol://username:password@host:port/path/file?querystring#mappath
		   
    and the elements of the array returned from this function are:
		
       [0] = sURL
       [1] = protocol
       [2] = username
       [3] = password
       [4] = host
       [5] = port
       [6] = path
       [7] = file
       [8] = querystring
       [9] = mappath
		
    any URL parts that are not specifically declared in sURL will return a
    a null value for their array element (i.e. if the string "www.msn.com"
    was passed to this function, then only elements [0] and [4] would have
    values; all other elements in the array would return null). 
 
    Regular Expression details:
    RegExp = /^
		(?:
			([a-zA-Z]+)\:\/\/			// protocol
		)?
		(
			?:([^\:^\@]*?)				// username
			(?:\:(.*?))?				// password
			\@
		)?
		(
			[a-zA-Z0-9\.\_\-]*?			// host
		)
		(?:
			\:([0-9]{1,100})			// port
		)?
		(?:								
			(\/(?:[^\?]*?\/)*)			// path
			([^\?]*?)?					// file
			(?:\?(.*?))?				// querystring
			(?:#(.*))?					// anchor
		)?
		$/;
    _______________________________________________________
    */    
    function ParseURL(sURL) {
		RegExp = /^(?:([a-zA-Z]+)\:\/\/)?(?:([^\:^\@]*?)(?:\:(.*?))?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,100}))?(?:(\/(?:[^\?]*?\/)*)([^\?]*?)?(?:\?(.*?))?(?:#(.*))?)?$/;
		aUrlParts = RegExp.exec(sURL);
		return aUrlParts;
	}
	
	
	/*______________________________________________________
 
	Name:		ShowNeedUpdate()
	Purpose:	inform the user they need to install an
	            updated version of MSXML from 832414 
	Parameter:	none
	
	NOTE: this sample was written at a time when 832414 had
	      the only fix to msxml?.dll that would allow 
	      credentials to be passed via the XMLHTTP.Open 
	      method, if the computer has a wininet.dll that 
	      ships with MS04-004 (KB 832894) or later (dated
	      January 2004 or later).  
	      
          Detection is based ont he following criteria:
             MSXML 2.5 SP3 | msxml.dll  | 8.0.xxxx.x
             MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x
             MSXML 3.0 SP2 | msxml3.dll | 8.20.xxxx.x
             MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x
             MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x
             MSXML 4.0 SP2 | msxml4.dll | 4.20.xxxx.x
    _______________________________________________________
    */	
    function ShowNeedUpdate() {
		try {
			arFileInfo = GetVersion();
			if ( isArray(arFileInfo) ) {
				switch (arFileInfo[0].toLowerCase()) {
					case "msxml.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 8.0 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/c/e/8/ce81bc31-1ecf-46a3-b840-2839415e34ad/KB832414_MSXML2.5_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml2.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 8.3 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/1/0/e/10e23019-f7aa-4497-8e13-94ff06a08ce1/KB832414_MSXML2.6_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml3.dll":
						
						if ( GetXMLVersion(arFileInfo[1]) == 8.2 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/d/1/3/d139c2ad-6c6f-4d34-8db6-c44fe968227f/KB832414_MSXML3.0_x86.exe");
						}
						else if ( GetXMLVersion(arFileInfo[1]) == 8.3 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/b/1/9/b191831f-9a19-4a42-8a71-b2b267b4c715/KB832414_MSXML3.0_x86.exe");
							alert("I didn't think I'd be here");
						}
						else if ( GetXMLVersion(arFileInfo[1]) == 8.4 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/7/f/b/7fb9bddd-c56b-4ed6-b49b-b5e8718dd778/KB832414_MSXML3.0_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml4.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 4.2 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/a/f/d/afdb1779-18d6-4fd8-bb86-bfbfca5acaee/KB832414_MSXML4.0_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					default:
						GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						break;
				}
			}
		}
		catch(ex) {
			document.body.innerHTML = ErrorGenerator(ex) ;
		}
	}
 
 
	/*_____________________________________________________
 
	Name:		GenerateXMLDLLink()
	Purpose:	display location for XML download
	Param[in]:	sDLLName - name of MSXML DLL found 
	            sDLLVersion - version of MSXML DLL 
	            sUpdateLink - URL to download update from
	_______________________________________________________
    */		
	function GenerateXMLDLLink(sDLLName, sDLLVersion, sUpdateLink) {
		sMessage  = "The following file is registered to load when <code>Microsoft.XMLHTTP</code> is instantiated on your computer:<BR><BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th></tr><tr><td>" + sDLLName + "</td><td>" + sDLLVersion + "</td></tr></table></td></tr></table><BR>";
		sMessage += "To download the updated version of this module, click <a href=\"" + sUpdateLink + "\">here</a> and then select Open<BR><BR><BR><BR>";
		sMessage += "For more information about this update, see the article below:<BR><BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;832414 XMLHTTP call fails for URLs with embedded user credentials<BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a>";
		document.body.innerHTML = sMessage;
    }
    
    
	/*_____________________________________________________
 
	Name:		GenerateXMLNotMatched()
	Purpose:	display location for XML download
	Param[in]:	sDLLName - name of MSXML DLL found 
	            sDLLVersion - version of MSXML DLL 
	_______________________________________________________
    */		
    function GenerateXMLNotMatched(sDLLName, sDLLVersion) {
		sMessage  = "The following file is registered to load when <code>Microsoft.XMLHTTP</code> is instantiated on your computer:<BR><BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th></tr><tr><td>" + sDLLName + "</td><td>" + sDLLVersion + "</td></tr></table></td></tr></table><BR>";
		sMessage += "Unfortunately this does not match any of the supported versions of MSXML that were patched following the release of MS04-004.  This message can also occur if you have a version newer than one of the following:<BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th><th>product</th></tr>";
		sMessage += "   <tr><td>msxml.dll</td><td>8.0.7002.0</td><td>MSXML 2.5 SP3</td></tr>"
		sMessage += "   <tr><td>msxml2.dll</td><td>8.30.9528.0</td><td>MSXML 2.6 SP2</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.20.9823.0</td><td>MSXML 3.0 SP2</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.30.9929.0</td><td>MSXML 3.0 SP3</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.40.9509.0</td><td>MSXML 3.0 SP4</td></tr>"
		sMessage += "   <tr><td>msxml4.dll</td><td>4.20.9821.0</td><td>MSXML 4.0 SP2</td></tr>"
		sMessage += "</table></td></tr></table><BR>";
		sMessage += "For more information about the patches, see the article below:<BR><BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;832414 XMLHTTP call fails for URLs with embedded user credentials<BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a>";
		document.body.innerHTML = sMessage;
    }
 
 
	/*_____________________________________________________
 
	Name:		GetXMLVersion()
	Purpose:	determine if object passed in is an array
	Param[in]:	sDLLVersion - full version string of DLL
	_______________________________________________________
    */		
	function GetXMLVersion(sDLLVersion) {
		fltDLLVer = parseFloat(sDLLVersion.slice(0,3));
		if ( isNaN( fltDLLVer ) ) {
			return 0;
		}
		else {
			return fltDLLVer;
		}
	}
 
	/*_____________________________________________________
 
	Name:		isArray()
	Purpose:	determine if object passed in is an array
	Param[in]:	obj - an object
	_______________________________________________________
    */		
	function isArray(obj) {
		intArrayFound = -1;
		try {
			intArrayFound = obj.constructor.toString().indexOf("Array");
			if ( intArrayFound != -1)
				return true;
			else
				return false;
			
		}
		catch (ex) {}
	}
		
	
	/*_____________________________________________________
 
	Name:		ErrorGenerator()
	Purpose:	generate detailed output when errors occur
	Param[in]:	ex - an error object
	_______________________________________________________
    */		
	function ErrorGenerator(ex) { 
		switch(ex.number) {
			case -2146827859:   //occurs when unsafe ActiveX components try to execute; probably from Registry read with WScript
			    sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
			    sError += "<BR><BR>Automatic detection of your XML version requires that you click the <code>Yes</code> button on the diaolog with the message <code>An ActiveX control on this page might be unsafe to interact with other parts of the page.  Do you want to allow this interaction?</code><BR><BR>To automatically detect the version of XML you are running, click <a href=JavaScript:history.go(0)>here</a>, then click <code>Yes</code> in the popup dialog";
				sError += "<BR><BR><HR><BR>If you cannot click the <code>Yes</code> button to automatically detect the installed version of MSXML, you can manually determine which version of the required patch for this system (the patch is specific to the version and service pack level of MSXML installed on the computer), follow the steps below:";
				sError += "<ol>" ;
				sError += "   <li>open the Windows Explorer</li>";
				sError += "   <li>Navigate to the \Windows\System32</li>";
				sError += "   <li>right click on the file msxml?.dll</li>";
				sError += "   <li>select Properties</li>";
				sError += "   <li>click the Version tab</li>" ;
				sError += "   <li>note the version number of the file (supported versions of MSXML are listed below):</li>" 
				sError += "      <ul>";
				sError += "          <li>MSXML 2.5 SP3 | msxml.dll | 8.0.xxxx.x</li>";
				sError += "          <li>MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP2 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x</li>";
				sError += "          <li>MSXML 4.0 SP2 | msxml4.dll | 8.20.xxxx.x</li>";
				sError += "      </ul>";
				sError += "</ol>" ;
				break;
			case -2146828218:  //occurs when trying to use a component on a page in an untrusted zone (in this case XMLHTTP) to connect to a URL different than the current site
				aUrlForThisPage = ParseURL(document.URL);
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to explicitely trust the site to maintain continued functionality.  To add this trust, follow the steps below:<BR><BR>";
				sError += "<ol>" ;
				sError += "   <li>from the menu in this window, select <code>Tools | Internet Options</code></li>" ;
				sError += "   <li>select the <code>Security</code> tab</li>" ;
				sError += "   <li>select the <code>Trusted sites</code> icon</li>" ;
				sError += "   <li>click <code>Sites</code> button</li>" ;
				sError += "   <li>in the box labeled <code>Add this Web site to the zone</code>, enter the text: <font color=blue>" + aUrlForThisPage[4] + "</font></li>" ;
				sError += "   <li>click the <code>Add</code> button</li>" ;
				sError += "   <li>click the <code>Close</code> button</li>" ;
				sError += "   <li>click the <code>Custom Level</code> button</li>" ;
				sError += "   <li>locate the \'Miscellaneous | Access data sources across domains\' section</li>" ;
				sError += "   <li>click the <code>Enable</code> button under the \'Access data sources across domains\' section</li>" ;
				sError += "   <li>click the <code>OK</code> button to close the \'Security Settings\' dialog</li>" ;
				sError += "   <li>click the <code>OK</code> button to close the \'Internet Options\' dialog</li>" ;
				sError += "   <li>click <a href=JavaScript:history.go(0)>here</a> once all other steps are complete</li>";
				sError += "</ol>" ;
				sError += "<br><br><br><b>Note:</b> these steps rely on the default configuration of \'Access data sources across domains\' being enabled in the \'Trusted sites\' zone.  For more information on this see the article:";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;182569 - Description of Internet Explorer Security Zones Registry Entries";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=182569\">http://support.microsoft.com/?id=832414</a>";
				break;
			case -2147221020:  //'Invalid Syntax' error; occurs when Q832414 or later version of msxml?.dll has been called
				
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to install the critical update Q832414.<BR><BR>";
				sError += "Click <a href=JavaScript:ShowNeedUpdate()>here</a> to automatically detect the version of the update you need to install to use this site.<BR>"
				sError += "If you choose to manually install the update, you will need to determine the correct version for your system and download the update from the article below:<BR><BR>";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;832414 - XMLHTTP call fails for URLs with embedded user credentials";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a><BR><BR>";
				sError += "To determine which version of the patch is required (the patch is specific to the version and service pack level of MSXML installed on the computer), follow the steps below:";
				sError += "<ol>" ;
				sError += "   <li>open the Windows Explorer</li>";
				sError += "   <li>Navigate to the \Windows\System</li>";
				sError += "   <li>right click on the file msxml?.dll</li>";
				sError += "   <li>select Properties</li>";
				sError += "   <li>click the Version tab</li>" ;
				sError += "   <li>note the version number of the file (supported versions of MSXML are listed below):</li>" 
				sError += "      <ul>";
				sError += "          <li>MSXML 2.5 SP3 | msxml.dll | 8.0.xxxx.x</li>";
				sError += "          <li>MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP2 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x</li>";
				sError += "          <li>MSXML 4.0 SP2 | msxml4.dll | 8.20.xxxx.x</li>";
				sError += "      </ul>";
				sError += "</ol>" ;
				break;
			/*
			case null:	
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to install the critical update Q832414.<BR><BR>To manually install the update, download the update from the article below:<BR><BR>";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;832414 - XMLHTTP call fails for URLs with embedded user credentials";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a><BR><BR>";
				break;
			*/
			default:
				sError = "<table bgcolor=\"#C0C0C0\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B>\n" + ex.number + " - " + ex.description + "</font></td></tr></table>";
				break;
			}
			return sError;
		}
 
</SCRIPT>
<STYLE TYPE="text/css">
	<!--
		BODY {font-family: Arial; font-size: 12px}
		TABLE {font-family: Arial; font-size: 12px}
	-->
</STYLE>
</HEAD>
<BODY onLoad="DoIt()"> 
Redirecting, please stand by...
</BODY>
</HTML>

Open in new window

0
 

Author Closing Comment

by:Jakibrown
ID: 31547113
Extremely pleased with this solution, this was really an annoying problem and to have someone actually fix it when MS said it couldn't be done is really wonderful! THANK YOU! YOU ARE A STAR!
0
 
LVL 2

Expert Comment

by:Delightend
ID: 26615166
drfresh,
 
The above example works like a dream in opera, chrome, firefox and IE 8 on windows xp, it also works perfectly on chrome, opera and firefox on windows 7. However on in IE8 on windows 7 it does not work. Can you please help me understand why? is there a different msxml dll that needs to be used for windows 7?

In windows 7 it appears that the username and password are being sent as variables in the url string like this:
http://website.com/homepage.aspx?user=user&pass=pass
Then the redirection does occur but the credentials are gone and I am once again prompted for them.

What am I missing?

Here is the code I am using:

<?php
$user=$_REQUEST['user'];
$pass=$_REQUEST['pass'];
$url="http://".$user.":".$pass."@website.com/homepage.aspx";
echo '<html>';
echo '<head>';
?>
 
<TITLE>Interim Redirect Page</TITLE>
 
<script language="Javascript">
function DoIt() {
 
if ( window.ActiveXObject ) {
    // IE
	RedirectBrowser("<? echo $url; ?>");
}
else {
  // Firefox
  $url = "http://user:pass@website.com/homepage.aspx";
  document.location="<? echo $url; ?>";
  
  
}
 
 
}
 
</SCRIPT>
 
 
 
 
 
<SCRIPT Language="JavaScript" RUNAT="Client">
 
 
	/*_____________________________________________________
 
	Name:		GetUrlWithCreds()
	Purpose:	retrieve a URL from a specified location
	            which is returned from a server in a header
	            value called "Redirect-Location"
	Param(in):  none
	_______________________________________________________
    */
	function GetUrlWithCreds() { 
		//store the URL for the resource that will return the URL that includes the Basic auth credentials below:
		sURL = "http://website.com/homepage.aspx";
		//create the XMLHTTP object to retrieve the URL that has embedded creds
		oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
		oXMLHttp.Open("GET", sURL, false);
		oXMLHttp.Send();
		if ( oXMLHttp.status == 200) {
			sURLwCreds = oXMLHttp.getResponseHeader("Redirect-Location");
		}
		else {
			sURLwCreds = "Error = redirect not received from:\n\t" + sURL;
			alert(sURLwCreds + "\nstatus code = " + oXMLHttp.status);
		}
		oXMLHttp = null;
		RedirectBrowser(sURLwCreds);
    }
    
    
	/*_____________________________________________________
 
	Name:		LoadPage()
	Purpose:	sets the location of the current window
	            to be the URL passed to this function
	Param(in):  UrlToReload - a valid URL
	_______________________________________________________
    */
    function LoadPage(UrlToReload) {
    	window.location.href=UrlToReload;
    }
    
    
	/*_____________________________________________________
 
	Name:		RedirectBrowser()
	Purpose:	sets the location of the current window
	            to be the URL passed to this function
	Param(in):  sUrlwCreds - a URL with credentials 
	                         embedded between the protocol
	                         and host sections
	_______________________________________________________
    */    
    function RedirectBrowser(sUrlwCreds) {
    	aCurrentUrl = new ParseURL(sUrlwCreds);
		for (i = 1 ; i < aCurrentUrl.length ; i++) {
			if (aCurrentUrl[i] == null) {
				aCurrentUrl[i] = "";
			}
		}
		sURLwoCreds = aCurrentUrl[1] + "://" + aCurrentUrl[4];
		if (aCurrentUrl[5].length > 1) {
			sURLwoCreds += ":" + aCurrentUrl[5];
		}
		sURLwoCreds += aCurrentUrl[6] + aCurrentUrl[7]; 
		if (aCurrentUrl[8].length > 1) {
			sURLwoCreds += "?" + aCurrentUrl[8];
		}
		if (aCurrentUrl[9].length > 1) {
			sURLwoCreds += "#" + aCurrentUrl[9];
		}
		oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
		try {
			oXMLHttp.Open("GET", sURLwoCreds, false, aCurrentUrl[2], aCurrentUrl[3]);
			oXMLHttp.Send();
			if ( oXMLHttp.status == 200 ) {
				//if all goes well, WinInet should now be authenticated on destination site so
				//   setting the current window's URL to that site will not prompt for credentials
				LoadPage(sURLwoCreds);
			}
			else {
				alert("Error - an unexepected status code was returned: " + oXMLHttp.status);
			}
		}
		catch(ex) {
			document.body.innerHTML = ErrorGenerator(ex);
		}
    }
 
 
	/*_____________________________________________________
 
	Name:		GetCLSID()
	Purpose:	retrieve a CLSID for a registered component
	Parameter:  sProgID - string that is a ProgID for a
	                      given registered component on
	                      the local computer.
	_______________________________________________________
    */
    function GetCLSID(sProgID) {
		try {
			var oWshShell = new ActiveXObject("WScript.Shell");
			return oWshShell.RegRead("HKCR\\" + sProgID + "\\CLSID\\");
		}
		catch(ex) {
			return "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table><BR><BR>unable to read registry using WshShell.RegRead";
		}
	}
	
	
	/*______________________________________________________
 
	Name:		GetInProcServer32()
	Purpose:	retrieve a DLL path for a registered 
	            component
	parameter:  sCLSID - string that is a CLSID for a
	                     given registered component on 
	                     the local computer.
    _______________________________________________________
    */
    function GetInProcServer32(sCLSID) {
		try {
			var oWshShell = new ActiveXObject("WScript.Shell");
			return oWshShell.RegRead("HKCR\\CLSID\\" + sCLSID + "\\InProcServer32\\");
		}
		catch(ex) {
			return "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table><BR><BR>unable to read registry using WshShell.RegRead";
		}
	}
 
 
	/*______________________________________________________
 
	Name:		GetVersion()
	Purpose:	Retrieve file version from PE header
	Parameter:	none
	
	NOTE: a description of the RegExp object used in 
	      this function is provided below:
      		the following Regular Expression:
			    (?:(%(.*?)%))(?:(\\(?:[^\?]*?\\)*)([^\?]*?)$)
			will seperate the string:
			    %SystemRoot%\System32\Inetsrv\w3core.dll
			into the following array elements (all strings):
		       array[0] = %SystemRoot%\System32\Inetsrv\w3core.dll
		       array[1] = %SystemRoot%
		       array[2] = SystemRoot
		       array[3] = \System32\Inetsrv\
		       array[4] = w3core.dll
    _______________________________________________________
    */
	function GetVersion() {
		var sSysPath = "";
		//generate the Path to the DLL being used to call XMLHTTP
		try {
			sXmlDllPath = GetInProcServer32(GetCLSID("Microsoft.XMLHTTP"));
			RegExp = /(?:(%(.*?)%))(?:(\\(?:[^\?]*?\\)*)([^\?]*?)$)/;
			if ( RegExp.test(sXmlDllPath) ) {
				arDllPath = RegExp.exec(sXmlDllPath);
				var oWSH;
				oWSH = new ActiveXObject("WScript.Shell");
				sSysPath = oWSH.Environment("PROCESS").Item(arDllPath[2]) + arDllPath[3] + arDllPath[4];
			}
			else {
				sSysPath = sXmlDllPath;
			}
		} 
		catch(e) {
			//return e.number + " - " + e.description + "\n\nWScript.Shell is needed to get DLL versions";
			document.body.innerHTML = ErrorGenerator(e);
		}
		// get the version of the file
		try {
			var oFSO;
			oFSO = new ActiveXObject("Scripting.FileSystemObject");
			arrReturned = new Array(2);
			arrReturned[0] = arDllPath[4];
			arrReturned[1] = oFSO.getFileVersion(sSysPath);
			return arrReturned;
		}
		catch(e) {
			//return e.number + " - " + e.description + "\n\nScripting.FileSystemObject is needed to get DLL versions";
			document.body.innerHTML = ErrorGenerator(e);
		}
	}
	
	
	/*_____________________________________________________
 
	Name:		ParseURL()
	Purpose:	Retrieve file version from PE header
	Parameter:	sURL: string that has is a URL in the
	            format specified in the details section
	            below.
    Return:     Array with URL parts
	                
    This function uses JavaScript's regular expression object to parse the
    URL passed to it, and return the parts of the URL in array elements.
 
      --------------------------------------------------------------------
      NOTE: URL canonicalization is a non-trivial task and this simplified 
            sample does not account for URL escaping or encoding where the
            address http://www.microsoft.com/security/ is equivalent to the
            address http%3A%2F%2Fwww%2Emicrosoft%2Ecom%2Fsecurity%2F 
      --------------------------------------------------------------------
 
    The proper format of the URL that should be passed to this function is:
		
      protocol://username:password@host:port/path/file?querystring#mappath
		   
    and the elements of the array returned from this function are:
		
       [0] = sURL
       [1] = protocol
       [2] = username
       [3] = password
       [4] = host
       [5] = port
       [6] = path
       [7] = file
       [8] = querystring
       [9] = mappath
		
    any URL parts that are not specifically declared in sURL will return a
    a null value for their array element (i.e. if the string "www.msn.com"
    was passed to this function, then only elements [0] and [4] would have
    values; all other elements in the array would return null). 
 
    Regular Expression details:
    RegExp = /^
		(?:
			([a-zA-Z]+)\:\/\/			// protocol
		)?
		(
			?:([^\:^\@]*?)				// username
			(?:\:(.*?))?				// password
			\@
		)?
		(
			[a-zA-Z0-9\.\_\-]*?			// host
		)
		(?:
			\:([0-9]{1,100})			// port
		)?
		(?:								
			(\/(?:[^\?]*?\/)*)			// path
			([^\?]*?)?					// file
			(?:\?(.*?))?				// querystring
			(?:#(.*))?					// anchor
		)?
		$/;
    _______________________________________________________
    */    
    function ParseURL(sURL) {
		RegExp = /^(?:([a-zA-Z]+)\:\/\/)?(?:([^\:^\@]*?)(?:\:(.*?))?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,100}))?(?:(\/(?:[^\?]*?\/)*)([^\?]*?)?(?:\?(.*?))?(?:#(.*))?)?$/;
		aUrlParts = RegExp.exec(sURL);
		return aUrlParts;
	}
	
	
	/*______________________________________________________
 
	Name:		ShowNeedUpdate()
	Purpose:	inform the user they need to install an
	            updated version of MSXML from 832414 
	Parameter:	none
	
	NOTE: this sample was written at a time when 832414 had
	      the only fix to msxml?.dll that would allow 
	      credentials to be passed via the XMLHTTP.Open 
	      method, if the computer has a wininet.dll that 
	      ships with MS04-004 (KB 832894) or later (dated
	      January 2004 or later).  
	      
          Detection is based ont he following criteria:
             MSXML 2.5 SP3 | msxml.dll  | 8.0.xxxx.x
             MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x
             MSXML 3.0 SP2 | msxml3.dll | 8.20.xxxx.x
             MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x
             MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x
             MSXML 4.0 SP2 | msxml4.dll | 4.20.xxxx.x
    _______________________________________________________
    */	
    function ShowNeedUpdate() {
		try {
			arFileInfo = GetVersion();
			if ( isArray(arFileInfo) ) {
				switch (arFileInfo[0].toLowerCase()) {
					case "msxml.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 8.0 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/c/e/8/ce81bc31-1ecf-46a3-b840-2839415e34ad/KB832414_MSXML2.5_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml2.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 8.3 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/1/0/e/10e23019-f7aa-4497-8e13-94ff06a08ce1/KB832414_MSXML2.6_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml3.dll":
						
						if ( GetXMLVersion(arFileInfo[1]) == 8.2 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/d/1/3/d139c2ad-6c6f-4d34-8db6-c44fe968227f/KB832414_MSXML3.0_x86.exe");
						}
						else if ( GetXMLVersion(arFileInfo[1]) == 8.3 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/b/1/9/b191831f-9a19-4a42-8a71-b2b267b4c715/KB832414_MSXML3.0_x86.exe");
							alert("I didn't think I'd be here");
						}
						else if ( GetXMLVersion(arFileInfo[1]) == 8.4 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/7/f/b/7fb9bddd-c56b-4ed6-b49b-b5e8718dd778/KB832414_MSXML3.0_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					case "msxml4.dll":
						if ( GetXMLVersion(arFileInfo[1]) == 4.2 ) {
							GenerateXMLDLLink(arFileInfo[0], arFileInfo[1], "http://download.microsoft.com/download/a/f/d/afdb1779-18d6-4fd8-bb86-bfbfca5acaee/KB832414_MSXML4.0_x86.exe");
						}
						else {
							GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						}
						break;
					default:
						GenerateXMLNotMatched(arFileInfo[0], arFileInfo[1]);
						break;
				}
			}
		}
		catch(ex) {
			document.body.innerHTML = ErrorGenerator(ex) ;
		}
	}
 
 
	/*_____________________________________________________
 
	Name:		GenerateXMLDLLink()
	Purpose:	display location for XML download
	Param[in]:	sDLLName - name of MSXML DLL found 
	            sDLLVersion - version of MSXML DLL 
	            sUpdateLink - URL to download update from
	_______________________________________________________
    */		
	function GenerateXMLDLLink(sDLLName, sDLLVersion, sUpdateLink) {
		sMessage  = "The following file is registered to load when <code>Microsoft.XMLHTTP</code> is instantiated on your computer:<BR><BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th></tr><tr><td>" + sDLLName + "</td><td>" + sDLLVersion + "</td></tr></table></td></tr></table><BR>";
		sMessage += "To download the updated version of this module, click <a href=\"" + sUpdateLink + "\">here</a> and then select Open<BR><BR><BR><BR>";
		sMessage += "For more information about this update, see the article below:<BR><BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;832414 XMLHTTP call fails for URLs with embedded user credentials<BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a>";
		document.body.innerHTML = sMessage;
    }
    
    
	/*_____________________________________________________
 
	Name:		GenerateXMLNotMatched()
	Purpose:	display location for XML download
	Param[in]:	sDLLName - name of MSXML DLL found 
	            sDLLVersion - version of MSXML DLL 
	_______________________________________________________
    */		
    function GenerateXMLNotMatched(sDLLName, sDLLVersion) {
		sMessage  = "The following file is registered to load when <code>Microsoft.XMLHTTP</code> is instantiated on your computer:<BR><BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th></tr><tr><td>" + sDLLName + "</td><td>" + sDLLVersion + "</td></tr></table></td></tr></table><BR>";
		sMessage += "Unfortunately this does not match any of the supported versions of MSXML that were patched following the release of MS04-004.  This message can also occur if you have a version newer than one of the following:<BR>";
		sMessage += "<table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><table border=1><tr><th>module</th><th>version</th><th>product</th></tr>";
		sMessage += "   <tr><td>msxml.dll</td><td>8.0.7002.0</td><td>MSXML 2.5 SP3</td></tr>"
		sMessage += "   <tr><td>msxml2.dll</td><td>8.30.9528.0</td><td>MSXML 2.6 SP2</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.20.9823.0</td><td>MSXML 3.0 SP2</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.30.9929.0</td><td>MSXML 3.0 SP3</td></tr>"
		sMessage += "   <tr><td>msxml3.dll</td><td>8.40.9509.0</td><td>MSXML 3.0 SP4</td></tr>"
		sMessage += "   <tr><td>msxml4.dll</td><td>4.20.9821.0</td><td>MSXML 4.0 SP2</td></tr>"
		sMessage += "</table></td></tr></table><BR>";
		sMessage += "For more information about the patches, see the article below:<BR><BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;832414 XMLHTTP call fails for URLs with embedded user credentials<BR>";
		sMessage += "&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a>";
		document.body.innerHTML = sMessage;
    }
 
 
	/*_____________________________________________________
 
	Name:		GetXMLVersion()
	Purpose:	determine if object passed in is an array
	Param[in]:	sDLLVersion - full version string of DLL
	_______________________________________________________
    */		
	function GetXMLVersion(sDLLVersion) {
		fltDLLVer = parseFloat(sDLLVersion.slice(0,3));
		if ( isNaN( fltDLLVer ) ) {
			return 0;
		}
		else {
			return fltDLLVer;
		}
	}
 
	/*_____________________________________________________
 
	Name:		isArray()
	Purpose:	determine if object passed in is an array
	Param[in]:	obj - an object
	_______________________________________________________
    */		
	function isArray(obj) {
		intArrayFound = -1;
		try {
			intArrayFound = obj.constructor.toString().indexOf("Array");
			if ( intArrayFound != -1)
				return true;
			else
				return false;
			
		}
		catch (ex) {}
	}
		
	
	/*_____________________________________________________
 
	Name:		ErrorGenerator()
	Purpose:	generate detailed output when errors occur
	Param[in]:	ex - an error object
	_______________________________________________________
    */		
	function ErrorGenerator(ex) { 
		switch(ex.number) {
			case -2146827859:   //occurs when unsafe ActiveX components try to execute; probably from Registry read with WScript
			    sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
			    sError += "<BR><BR>Automatic detection of your XML version requires that you click the <code>Yes</code> button on the diaolog with the message <code>An ActiveX control on this page might be unsafe to interact with other parts of the page.  Do you want to allow this interaction?</code><BR><BR>To automatically detect the version of XML you are running, click <a href=JavaScript:history.go(0)>here</a>, then click <code>Yes</code> in the popup dialog";
				sError += "<BR><BR><HR><BR>If you cannot click the <code>Yes</code> button to automatically detect the installed version of MSXML, you can manually determine which version of the required patch for this system (the patch is specific to the version and service pack level of MSXML installed on the computer), follow the steps below:";
				sError += "<ol>" ;
				sError += "   <li>open the Windows Explorer</li>";
				sError += "   <li>Navigate to the \Windows\System32</li>";
				sError += "   <li>right click on the file msxml?.dll</li>";
				sError += "   <li>select Properties</li>";
				sError += "   <li>click the Version tab</li>" ;
				sError += "   <li>note the version number of the file (supported versions of MSXML are listed below):</li>" 
				sError += "      <ul>";
				sError += "          <li>MSXML 2.5 SP3 | msxml.dll | 8.0.xxxx.x</li>";
				sError += "          <li>MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP2 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x</li>";
				sError += "          <li>MSXML 4.0 SP2 | msxml4.dll | 8.20.xxxx.x</li>";
				sError += "      </ul>";
				sError += "</ol>" ;
				break;
			case -2146828218:  //occurs when trying to use a component on a page in an untrusted zone (in this case XMLHTTP) to connect to a URL different than the current site
				aUrlForThisPage = ParseURL(document.URL);
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to explicitely trust the site to maintain continued functionality.  To add this trust, follow the steps below:<BR><BR>";
				sError += "<ol>" ;
				sError += "   <li>from the menu in this window, select <code>Tools | Internet Options</code></li>" ;
				sError += "   <li>select the <code>Security</code> tab</li>" ;
				sError += "   <li>select the <code>Trusted sites</code> icon</li>" ;
				sError += "   <li>click <code>Sites</code> button</li>" ;
				sError += "   <li>in the box labeled <code>Add this Web site to the zone</code>, enter the text: <font color=blue>" + aUrlForThisPage[4] + "</font></li>" ;
				sError += "   <li>uncheck the box Require server verification (https)... below the list</li>" ;	
				sError += "   <li>click the <code>Add</code> button</li>" ;
				sError += "   <li>click the <code>Close</code> button</li>" ;
				sError += "   <li>click the <code>Custom Level</code> button</li>" ;
				sError += "   <li>locate the \'Miscellaneous | Access data sources across domains\' section</li>" ;
				sError += "   <li>click the <code>Enable</code> button under the \'Access data sources across domains\' section</li>" ;
				sError += "   <li>click the <code>OK</code> button to close the \'Security Settings\' dialog</li>" ;
				sError += "   <li>click the <code>OK</code> button to close the \'Internet Options\' dialog</li>" ;
				sError += "   <li>click <a href=JavaScript:history.go(0)>here</a> once all other steps are complete</li>";
				sError += "</ol>" ;
				sError += "<br><br><br><b>Note:</b> these steps rely on the default configuration of \'Access data sources across domains\' being enabled in the \'Trusted sites\' zone.  For more information on this see the article:";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;182569 - Description of Internet Explorer Security Zones Registry Entries";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=182569\">http://support.microsoft.com/?id=832414</a>";
				break;
			case -2147221020:  //'Invalid Syntax' error; occurs when Q832414 or later version of msxml?.dll has been called
				
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to install the critical update Q832414.<BR><BR>";
				sError += "Click <a href=JavaScript:ShowNeedUpdate()>here</a> to automatically detect the version of the update you need to install to use this site.<BR>"
				sError += "If you choose to manually install the update, you will need to determine the correct version for your system and download the update from the article below:<BR><BR>";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;832414 - XMLHTTP call fails for URLs with embedded user credentials";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a><BR><BR>";
				sError += "To determine which version of the patch is required (the patch is specific to the version and service pack level of MSXML installed on the computer), follow the steps below:";
				sError += "<ol>" ;
				sError += "   <li>open the Windows Explorer</li>";
				sError += "   <li>Navigate to the \Windows\System</li>";
				sError += "   <li>right click on the file msxml?.dll</li>";
				sError += "   <li>select Properties</li>";
				sError += "   <li>click the Version tab</li>" ;
				sError += "   <li>note the version number of the file (supported versions of MSXML are listed below):</li>" 
				sError += "      <ul>";
				sError += "          <li>MSXML 2.5 SP3 | msxml.dll | 8.0.xxxx.x</li>";
				sError += "          <li>MSXML 2.6 SP2 | msxml2.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP2 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP3 | msxml3.dll | 8.30.xxxx.x</li>";
				sError += "          <li>MSXML 3.0 SP4 | msxml3.dll | 8.40.xxxx.x</li>";
				sError += "          <li>MSXML 4.0 SP2 | msxml4.dll | 8.20.xxxx.x</li>";
				sError += "      </ul>";
				sError += "</ol>" ;
				break;
			/*
			case null:	
				sError = "<table bgcolor=\"lightgrey\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B><BR>" + ex.number + " : " + ex.description + "</font></td></tr></table>";
				sError += "<BR><BR>Due to a recent security update, this site now requires user's to install the critical update Q832414.<BR><BR>To manually install the update, download the update from the article below:<BR><BR>";
				sError += "<br><br>&nbsp;&nbsp;&nbsp;832414 - XMLHTTP call fails for URLs with embedded user credentials";
				sError += "<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"http://support.microsoft.com/?id=832414\">http://support.microsoft.com/?id=832414</a><BR><BR>";
				break;
			*/
			default:
				sError = "<table bgcolor=\"#C0C0C0\" cellpadding=5><tr><td><font color=\"darkred\"><B>" + ex.name + "</B>\n" + ex.number + " - " + ex.description + "</font></td></tr></table>";
				break;
			}
			return sError;
		}
 
</SCRIPT>
<STYLE TYPE="text/css">
	<!--
		BODY {font-family: Arial; font-size: 12px}
		TABLE {font-family: Arial; font-size: 12px}
	-->
</STYLE>
</HEAD>
<BODY onLoad="DoIt()"> 
Redirecting, please stand by...
</BODY>
</HTML>

Open in new window

0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question