Well just a quick post, I’ve started using a new host recently and i’ve been installing oscommerce. Part of oscommerce’s installation process requires the root address on the server to the files but the host didn’t seem to disclose this information so i found the following line of PHP which does the trick.
1) Create a page i.e. root-test.php
2) Add the following line of code to the page:
Remove the spaces appropriately from around the question marks:
< ? = $_SERVER['DOCUMENT_ROOT']; ? >
3) Upload the file.
4) Then go to the file online i.e. http://www.yourdomain.com/root-test.php
It will then give you the appropriate results i.e.
/home/1234/username/www.yourdomain.co.uk/public_html/
Useful piece of code!








This isn’t working for me. Any reason, you know of, why it might not. I use HOSTGATOR.
Thanks in advance!
Actually, figured it out on my own. Need ECHO in there:
ACtually, figured it out on my own. Here is php:
(take spaces out)
Dang it. Can the administrator delete previous. Just add “echo” in place of the “=” sign.