I'm trying to use $_SERVER['DOCUMENT_ROOT']
to make it easier to use links where I could call the variable in any directory on the site. To use with include($pagina_inicial)
works, but for link does not work:
For example:
<?php
$pagina_inicial = $_SERVER['DOCUMENT_ROOT'] . '/index.php';
?>
<a href="<?php $pagina_inicial ?>">Link</a>
// Seria o equivalente disso:
<a href="www.site.com/index.php">Link</a>
// Mas está retornando assim:
// http://www.site.com/home/u711323471/public_html/index.php
Does anyone know how I can do this?