<?php
function check_login()
{
if(strlen($_SESSION['loginid'])==0)
	{
		$host = $_SERVER['HTTP_HOST'];
		$uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
		$extra="index.php";
		
		unset($_SESSION['loginid']);
		unset($_SESSION['loginname']);
		session_destroy();

		header("Location: http://$host$uri/$extra");
	}
}
