Sorry, I didn’t post the code because it matched your previous code.
Login.php
[php]
Basic CMS - Admin Area - Login
<?PHP
session_start();
if(isset($_SESSION['user']))
header("Location: index.php");
?>
[/php]
Dologin.php
[php]
<?php
include('includes/functions.php');
start_session();
if(isset($_POST(['login'])){
if($_POST['username'])){
if($_POST['password'])){
$query = mysql_query("SELECT * users WHERE Username = mysql_real_escape_string
($_POST['username'])") or die(mysql_error());
$user = mysql_fetch_array($query);
if(md5($_POST['password'] == $user['Password']){
echo "Login successful";
$_SESSION['user'] = $user['Username'};
header("Location: admin/index.php");
}else{
echo "Please check your login details!";
include('login.php');
}
}else{
echo "Please check your password is correct!";
include('login.php');
}
}else{
echo "Please check your username is correct!";
include('login.php');
}else{
echo "Please check you filled out the login form!";
include('login.php');
}
?>[/php]
Index.php
[php]
<?php
session_start();
if(!isset($_SESSION['user']))
header("Location: admin/login.php");
?>
Basic CMS - Admin Area
This is test text....it does not appear on screen.
Logged In! Welcome <?php> echo $_SESSION['user']; ?>
Logout
Manage Posts
[/php]
I attempted to debug with die(“Got here…”); but after inserting this code in every available space in my dologin.php page, it was never visable after logging in. It appears that after logging in I am redirected to the dologin.php page and nothing happens from there.
Once again, ill be very greatful for any help