我正在开展一个项目,我正在学习使用导航头文件并在其他文件中包含该头文件的重要性,以便我的导航将在所有其他视图中显示相同内容。
我遇到的问题是我链接到我的头文件的css没有应用到某个页面...我认为它与文件路径有关,但我不确定。有人可以看看我有什么,并给我一些见解?谢谢!
这是我的头文件:
<?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>
这是我的注册码:
<?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>