2016-07-04 20:42
浏览 48


I had some big problems calling my header at all from project1.php. It got solved with the header included like this:

<?php include $_SERVER['DOCUMENT_ROOT'] . '/vouzalis/resources/includes/header.php'; ?>

The header is now called, but all my CSS is not called. Howcome can that be? On all my pages there is lying in the root folder the CSS is working fine.

My folder structure is looking like this:

Folder structure

This code below is a snip of my header. As you can see Home should go to index.php. But when I am in my project1.php and I click on Home I get the URL: `


The correct root should be:


It does not make sense to be. Does anybody have a clue why? Is it something with how the header is included?

<div class="navbar-collapse collapse">
    <ul class="nav nav-pills nav-main pull-right">
        <!-- begin navigation items -->
        <li class="active"><a href="index.php">Home</a></li>
            <a href="services_smallicon.php">Services</a>
            <a href="portfolio.php">Portfolio</a>
            <a href="aboutme.php">About Me</a>
        <li><a href="contact.php">Contact</a></li>
        <!-- end navigation items -->
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doumu1212 2016-07-04 20:59

    I believe the problem is here:

    <li class="active"><a href="index.php">Home</a></li>

    Replace href="index.php" with href="/vouzalis/index.php". The / specifies the domain root, without it, the root is the your current location (/vouzalis/projects/).

    解决 无用
    打赏 举报

相关推荐 更多相似问题