I want to assign a variable to the current domain of the web page. When I'm developing the site, the domain is "
http://localhost/", but when I upload it the domain is "
http://www.badmintonbible.com/".
So I'm using this variable to make links work both locally and on the site itself.
I've tried using
$_SERVER['DOCUMENT_ROOT'], but this goes too deep: it returns all the server's file structure.
There must be a pre-assigned variable for this, but I haven't found it. Any ideas?