<?php ob_start();?>
<?php
session_start();
	if(!isset($_SESSION['username']) && !isset($_SESSION['userType']))
	{
		header('location:../index.php');
		exit();
	}
	// echo $id=preg_replace('#[^0-9]#i','',$_SESSION['id']);
	$username = $_SESSION['username'];
	$password = $_SESSION['password'];
	$userType = $_SESSION['userType'];
	
	include("connection.php");
	$sql="SELECT * FROM `users` WHERE `username`='$username' AND `password`='$password' AND type='$userType';";
	$result=mysql_query($sql);
	$count=mysql_num_rows($result);
	$admin_row = mysql_fetch_array($result);
	
	if($count==0)
	{
		echo "Your login session data not in database";
		exit();
	}
?>