html - Link to internal pages from include file - correct path from each page -
i have include file contains header section each of pages. finding difficult grasp fact index.php file in root of directory other pages in pages folder. how can correctly link when on shows page example, can link home page. might ../home.php happens when on home page, how link other pages because cannot show.php because not in same directory index.php file. have 1 header file these hyperlinks remember why finding difficult...
my directory follows:
css
fonts
images
includes
- header.php
js
pages
- about.php
- classes.php
- contact.php
- noticeboard.php
- shows.php
index.php
below links on have achieved far:
<li><a <?php if (strpos($_server['php_self'], 'index.php')) echo 'class="current"';?> href="../index.php">home</a></li> <li><a <?php if (strpos($_server['php_self'], 'shows.php')) echo 'class="current"';?> href="shows.php">shows</a></li> <li><a <?php if (strpos($_server['php_self'], 'classes.php')) echo 'class="current"';?> href="classes.php">classes</a></li> <li><a <?php if (strpos($_server['php_self'], 'noticeboard.php')) echo 'class="current"';?> href="noticeboard.php">notice board</a></li> <li><a <?php if (strpos($_server['php_self'], 'about.php')) echo 'class="current"';?> href="about.php">our story</a></li> <li><a <?php if (strpos($_server['php_self'], 'contact.php')) echo 'class="current"';?> href="contact.php">contact</a></li> thanks in advance
you can edit .htaccess file, this:
rewriteengine on
rewritebase /
and can go absolute paths follows:
/index.php
/pages/about.php
Comments
Post a Comment