I have the problem with header..
I am working on login functionality... in that
1)If the user logged in with his/her credentials...
2)After that user try to open new tab and type the LoginViewController.php..
3)Here i need to redirect the user to previous logged in page..based on seesion active ..
4)But the header is not redirecting to loggedin.php page.. and showing some blank page..
Here is the LoginViewController.php
<?php
session_start();
include('GenericClasses/GenericCollectionClass.php');
include('Models/UsersModel.php');
include('DataObjects/Users.php');
include('DatabaseAccess/DBHandler.php');
if(!empty($_SESSION['user']))// Here checking session is empty or not
{
header("Location : loggedin.php");// Here it is not redirecting properly
die();
}
else
{
}?>
Here is loggin.php
<?php
session_start();
header("Cache-Control: private, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Fri, 4 Jun 2010 12:00:00 GMT");
include('GenericClasses/GenericCollectionClass.php');
include('Models/UsersModel.php');
include('DataObjects/Users.php');
include('DatabaseAccess/DBHandler.php');
if(!isset($_SESSION['user']))
{
header('Location: LoginViewController.php');
exit();
}
echo '<div style="background:white; text-align:right"> Login as:'.$_SESSION['user'].'<a href="LogoutViewController.php" style="text-align:right">Logout</a></div>';
?>
Any suggestions are acceptable...