MySQL Forums
Forum List  »  PHP

Re: Header/Footer Error
Posted by: Logan Bangerter
Date: November 14, 2019 06:18PM

My header.php file has this code:

<?php
header('Content-Type: text/html; charset=iso-8859-1');
if ( !isset($_SESSION['email']) ) {
header('location:/waiting_lists/loginform.php');
}
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];
?>
<!DOCTYPE html>
<html>
<!-- the head section -->
<head>
<title>The Movie Loan System</title>
<link rel="stylesheet" type="text/css" href="/waiting_lists/styles.css">
</head>

<!-- the body section -->
<body>
Welcome <?=$first_name?> <?=$last_name?>
<header><h1>The Movie Loan System</h1> </header>

The page I'm trying to load called index.php has this code:

<?php
session_start();
include 'view/header.php';
?>
<main>
<h1>Menu</h1>
<ul>
<li>
<a href="users">Users</a>
</li>
<li>
<a href="movies">Movies</a>
</li>
<li>
<a href="checkouts/index.php?action=list_available_movies">Checkout</a>
</li>
<li>
<a href="waiting_lists">Waitlist</a>
</li>
</ul>
</main>
<?php include 'view/footer.php'; ?>

It should be noted that both files are stored in separate folders (index.php in "waiting_lists", and header.php in "view" but both are in the same root folder, though I'm not sure how much that contributes.

Options: ReplyQuote


Subject
Written By
Posted
November 14, 2019 02:16PM
November 14, 2019 02:31PM
Re: Header/Footer Error
November 14, 2019 06:18PM
November 14, 2019 07:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.