html/php: how to handle absolute url's?
- by YuriKolovsky
Is the html tag safe to use in terms of browser support? Or should I generate a root path with PHP which i then add like this <a href="<?=BASE?>somepage.html">somepage</a> which makes up a absolute url.
using the base tag like this <base href="<?=BASE?>" /> I am then able to use links like this
<a href="somepage.html">somepage</a>
now I am fully aware that it would be much easier to just do this without using the base tag:
<a href="/somepage.html">somepage</a>
but how do I test locally then with a base url of http://localhost/testsite/ ???