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!
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>