<?PHP
/*
* Copyright (c) www.baojisky.com All rights reserved. 
*/
ob_start(); 
$root_path='..';
include($root_path.'/php/connect_sub.php');
include($root_path.'/php/sub.php');

$jtime		=	date("Y-m-d H:i:s");
//??????
$inname=$_POST["inname"];
$inpwd=$_POST["inpwd"];

$loginnamec		=	$inname;
//??????		
$id		=	gmdate(date(U));
if ($inname != "" && $inpwd != "")
{
		$inpwd		=	md5($inpwd);
		$namee		=	"diy_admin";
		SetCookie($namee,"");
		
		$jtime		=	date("Y-m-d H:i:s");
		
		if ($inname == $site_username and  $inpwd==md5($site_psword))
		{
			//???ID??/????/username/???
			$che		=	array($site_userid,md5($site_psword),$site_username,$site_nickname);
			//§Õ??cookie
			$nhe		=	implode("||jsxeesed||",$che);
					$y2k="0";		
			SetCookie($namee,$nhe,$y2k,'/',''); 
		  include(parse_template('main'.'_x',$root_path.'/tpl/admin/',$root_path.'/admin/'));
		}
		else
		{
		
		include(parse_template('login'.'_x',$root_path.'/tpl/admin/',$root_path.'/admin/'));
		}	
}
else
{
		include(parse_template('main'.'_x',$root_path.'/tpl/admin/',$root_path.'/admin/'));
}
ob_end_flush();
?>

