dragon88112 2016-11-08 03:06
浏览 62

php require似乎不包含css文件

I'm working on a project where I am learning the importance of having a header file with a nav and including that header file in other files so that my nav will display the same in all other vies.

The problem I'm having is the css that I linked to my header file is not being applied to a certain page... I think it has to do with file paths but I'm not sure. Can someone take a look at what I have and give me some insight? Thanks!

css not being included

my file structure

Here is my header file:

<?php session_start(); 
$_SESSION['DOCUMENT_ROOT'] = 'login_system/';
?>
<!DOCTYPE html>

<html>
<head>
    <link href="css/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css">
    <script scr="scripts/main.js"></script>
    <title>Login page</title>
</head>
<body>
<div class="header">
    <div class="nav">
        <ul>
            <li><a href="index.php">Home</a></li>
            <?php 

            if (isset($_SESSION['id']))
                echo "<form action='includes/logout.php'>
                        <button>Log out</button>
                    </form>";
            else
                echo "<form action='includes/login.php' method='POST'>
                    <input type='text' name='username' placeholder='username'>

                    <input type='password' name='password' placeholder='Password'>
                    <button class='button-submit' type='submit'>Login</button>
                    </form>";
            ?>
            <li><a href="../views/signup/default.php">Sign up</a></li>
        </ul>
    </div>
</div>

and here is my signup code:

<?php require '../../includes/header.php'; ?>

<div class"container">
    <?php
    if (isset($_SESSION['id']))
        echo 'You are already logged in!';
    else
        echo "<form action='../../includes/signup.php' method='POST'>
                <label for='firstname'>First name:</label>
                <input type='text' name='firstname' placeholder='First name'><br>

                <label for='lastname'>Last name:</label>
                <input type='text' name='lastname' placeholder='Last name'><br>

                <label for='username'>Username:</label>
                <input type='text' name='username' placeholder='username'><br>

                <label for='lastname'>Desired Password:</label>
                <input type='password' name='password' placeholder='Password'><br>
                <button type='submit'>Sign up</button>
            </form>";
    ?>
</div>
</body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用visual studi code完成html页面
    • ¥15 聚类分析或者python进行数据分析
    • ¥15 逻辑谓词和消解原理的运用
    • ¥15 三菱伺服电机按启动按钮有使能但不动作
    • ¥15 js,页面2返回页面1时定位进入的设备
    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?