Hi,
I have this website which I am developing, but it is having display problems.
I have a directory called 'includes' which contains 'header.php', 'login.inc.php' and 'login_form.inc.php'
'header.php' - displays the normal doctype, meta tags, styles, etc.
'login.inc.php' - is the actual process of the login form once the form is submitted.
'login_form.inc.php' - is the actual display of the form.
Then in the main root folder I have a file called 'index.php'. The code for this can be seen below:
index.php
<?php
require ('./includes/config.inc.php');
require (MYSQL);
// This processes the login form for a user to log in.
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
include ('./includes/login.inc.php');
}
include ('./includes/header.php');
?>
So that works fine to a certain extent, but then in the 'header.php' file I have the following:
<?php
if (isset($_SESSION['user_id'])) {
echo '<a class="dropdown-toggle" href="#" data-toggle="dropdown">Your Profile <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<ul class="unstyled">
<li><a href="#">Change Password</a></li>
<li class="divider"></li>
<li><a href="#">Logout</a></li>
</ul>
';
} else {
echo '<a class="dropdown-toggle" href="#" data-toggle="dropdown">sign in <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">';
include ('includes/login_form.inc.php');
} ?>
It works, it displays the form but then when you visit the website and try any other links like 'register.php' or 'search.php' or 'forgot password.php' all the user is greated with is just the header.php file and then a blank white page.
Any comments, suggestions, help would be much apppreciated.
Regards
PHP5,
MySQL
Chrome