<?php ob_start(); session_start( );
include 'authenticate.php'; ?>
aurheticate.php--------->
<?php
mysql_connect("localhost", "root", "") or die (mysql_error());
mysql_select_db("pms") or die (mysql_error());
if (!isset( $_SESSION['user_id']))
{
if(!isset($_POST['txtuser_name']))
header('location:login(Admin).php');
$value=mysql_real_escape_string($_POST['user_value']);
$user_name = $_POST['txtuser_name'];
$pass = $_POST['txtpassword'];
//user isentification
if($value==1)
{ $query="select admin_name , admin_id from admin where admin_name='$user_name' AND admin_password='$pass'";
$sql = mysql_query ($query);
if ($result = mysql_fetch_array($sql))
{
//echo'inside fetch array';
$_SESSION['user_name'] = $result['admin_name'];
$_SESSION['user_id'] = $result['admin_id'];
$_SESSION['user_type']=$value;
}
else
{
header('location:login(Admin).php');
}
}
else if($value==2)
{ $query="select leader_name , leader_id from projectleader where leader_name='$user_name' AND leader_password='$pass'";
$sql = mysql_query ($query);
if ($result = mysql_fetch_array($sql))
{
//echo'inside fetch array';
$_SESSION['user_name'] = $result['leader_name'];
$_SESSION['user_id'] = $result['leader_id'];
$_SESSION['user_type']=$value;
}
else
{
header('location:login(Admin).php');
}
}
else if($value==3)
{ $query="select client_name , client_id from client where client_name='$user_name' AND client_password='$pass'";
$sql = mysql_query ($query);
if ($result = mysql_fetch_array($sql))
{
//echo'inside fetch array';
$_SESSION['user_name'] = $result['client_name'];
$_SESSION['user_id'] = $result['client_id'];
$_SESSION['user_type']=$value;
}
else
{
header('location:login(Admin).php');
}
}
//end of user check
}//end of session setting
?>
m getting this problem.. even after trying all d solutions given on previous such problems..