This is part of my navigation page but it sends me to mysite.com/mysite.com/myfolder.php
<a href ="<?php echo "http://".$_SERVER['SERVER_NAME']."/myfolder.php"; ?>">home</a>
Problem #1: sometimes $_SERVER['SERVER_NAME'] prints mysite.com and sometimes it prints http://www.mysite.com. im not sure if this could be a problem or not but i want it to always print the same thing so i dont run into strange problems in the future.
Problem #2: I will not know the website name so i need to be sure when they add this file that the home button on the navigation will send them to theirsite.com/myfolder/index
Use relative URLs. Instead of making the link point to http://mysite.com/myfolder.php or http://www.mysite.com/myfolder.php, make the link point to /myfolder.php. The browser knows that the host is http://www.mysite.com and that the protocol is HTTP, so the browser prepends the http://www.mysite.com part.
As an example, fire up your browser’s developer tools and inspect the StackOverflow logo at the top of this page. You’ll see that the markup is