Forum Moderators: coopster
<a href="index.php"><img src="images/logo.png" id="logo" /></a>
<header>
<nav>
<ul>
<li><a href="index.php">Home page</a></li>
<li><a href="about-us.php">About us?</a></li>
<li><a href="brands/index.php">Brands</a></li>
</ul>
</nav>
</header>
<a href="index.php"><img src="images/logo.png" id="logo" /></a>
<header>
<nav>
<ul>
<li><a href="index.php">Home page</a></li>
<li><a href="about-us.php">About us?</a></li>
<li><a href="brands/index.php">Brands</a></li>
</ul>
</nav>
</header>
Just start any HTML file reference with a forward slash e.g href="/brands/index.php",
are you saying that this is wrong:
<?php include '../includes/header.php'; ?>
and that I should replace "../" for "$_SERVER['DOCUMENT_ROOT']." when using php includes?
if (!defined('ROOT')) {
define('ROOT', preg_replace('/\/$/', '', $_SERVER['DOCUMENT_ROOT'])); //the root of the site
define('PHPFOLDER', preg_replace('/[^\/]+$/', 'php', ROOT)); //above root 'php' folder
define('MYPHPFOLDER', PHPFOLDER.'/my_php'); //above root 'php/my_php' folder
}
include(MYPHPFOLDER.'/header.php');
is "/" better than "/index.php" or vice versa or the difference is purely esthetic and I should bother which to pick?
are you saying that this is wrong:
<?php include '../includes/header.php'; ?>