First off, I have apache server installed on my computer, as well as the newest releases of php and mysql. Ideally, i like to do all site updates on my computer first, and then upload after they are finished.
I'm trying to use php coding instead of traditional html, and maybe I am overdoing things. Perhaps probably.
When doing typical html links, as a habit, I never link directly by <a href="http://www.mydomain.com/blah/blah.html">. Rather, I always link as follows: <a href="../blah/blah.html">, obviously depending on where the file that I am currently on resides within the site.
Anyway, that system works fine, but now that i'm learning php, i thought I'd do things in a fancy smancy type of way, and tried to link to the root of my homepage as follows:
<a href="<?php echo $_SERVER['DOCUMENT_ROOT'] . '/index.php'; ?">Home</a>
Although this may work on the actual live website, as i imagine that $SERVER['DOCUMENT_ROOT'] will link to the root of the domain, on my computer, $SERVER['DOCUMENT_ROOT'] is NOT linking to the root of the "server", that is, it is not linking to http: //localhost/. Rather, it is linking ot the exact path on my hard drive, such as c:\documents and setting\blah\blah\blah\website\index.php. And as such, this is not working correctly.
Is there a better php way of doing this? Or again, maybe on just trying to do too much. Perhaps it is best to just stick with the simple <a href="../blah/blah.html">.
Please advise.
Thanks.