_SERVER["DOCUMENT_ROOT"] problem with windows servers

Hi there,

I am running my website on windows server and I am faicing
SERVER[“DOCUMENT_ROOT”] problem with my website…

I’ve tried it converting it using…


if(!isset($_SERVER['DOCUMENT_ROOT']))
	{ if(isset($_SERVER['SCRIPT_FILENAME']))
		{$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
		};
	};
	if(!isset($_SERVER['DOCUMENT_ROOT']))
	{ if(isset($_SERVER['PATH_TRANSLATED']))
		{$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\\\', '/', substr(str_replace('\\\\\\\\', '\\\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))
			);
	};
};

in my php info file its showing:
_SERVER[“DOCUMENT_ROOT”] C:\HostingSpaces\rksmatri\aimanews.com\wwwroot

when I run the script in browser it flagging with the error:

Firefox doesn’t know how to open this address, because the protocol (c) isn’t associated with any program

Please let me know how can I fix this…

Thanks

The value of $_SERVER[‘DOCUMENT_ROOT’] indicates the directory that is the root of your web site. It is set by the web server and changing it with PHP code won’t change the web server’s document root directory.

With a document root of: C:\HostingSpaces\rksmatri\aimanews.com\wwwroot entering [FONT=“Courier New”]http://aimanews.com/test.php[/FONT] in a web browser will cause the server to fetch and process C:\HostingSpaces\rksmatri\aimanews.com\wwwroot\ est.php

The protocol is the first part of the URL - up to the ‘:’. Based upon your error message, I assume you entered: C:\HostingSpaces\rksmatri\aimanews.com\wwwroot into the browser - which doesn’t support a protocol of type ‘C’.

Thanks Mike…

But how can I remove this??

Do you have any ideas?

Please help…