<?php
session_start();
$host = 'localhost';
$username = 'mdsoftwareco_rns';
$password = 'w&S8zzGMx]QI';
$database = 'mdsoftwareco_rns';
$dbconfig = mysqli_connect($host,$username,$password,$database);

$db=mdsoftwareco_rns;
$link;
$link = mysql_connect( "localhost", "mdsoftwareco_rns", "w&S8zzGMx]QI" );
if ( ! $link )
die( "Couldn't connect to MySQL" );
mysql_select_db( $db, $link )
or die ( "Couldn't open iet: ".mysql_error() );
$username=$_SESSION['login_user'];
$type=$_SESSION['login_type'];
echo $code=$_SESSION['code'];
echo $session=$_SESSION['session'];
$login_type=$_SESSION['login_type'];
$sql_query="SELECT id FROM user WHERE username='$username' and type='$type' and code='$code'";
$result=mysqli_query($dbconfig,$sql_query);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
$count=mysqli_num_rows($result);
if($count=="")
{
header("location: logout.php");
}
?>