Log in

View Full Version : Login script for a php template?



Briggs
01-15-2008, 03:06 AM
Hey everyone.
Firstly, I must state how I've done this, and what I've tried...

Using tech_support's Making PHP Templates (http://www.dynamicdrive.com/forums/showthread.php?t=28260) tutorial, I have successfully created the website.
In harsh87 (http://www.dynamicdrive.com/forums/showthread.php?t=28358) thread, thetestingsite posted this (http://www.php-mysql-tutorial.com/user-authentication/index.php) link.
So I am trying to use the Basic User Authentication (http://www.php-mysql-tutorial.com/user-authentication/basic-authentication.php) one...

Anyways, I cannot seem to get this to work, because of
<?php
// like i said, we must never forget to start the session
session_start();

// is the one accessing this page logged in or not?
if (!isset($_SESSION['basic_is_logged_in'])
|| $_SESSION['basic_is_logged_in'] !== true) {

// not logged in, move to login page
header('Location: login.php');
exit;
}

?>
being in the header of my index page (as I am using a php template).

So... I need to find something that will work with a php template :)
Any suggestions?