<?
@require_once('../inc/fun.inc.php');
@require_once('../inc/config.db.php');
header("Content-type:text/html;charset=gb2312");
$user = $_POST["user"];
$pass = $_POST["pass"];
if(empty($user) || empty($pass))
{
	msg($wtime,"login.php","用户密码不能为空");
	exit;
}
$userpass = md5($pass);
$sql = "select id from admin where username='$user' and password='$userpass'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if($num == "1")
{
	setcookie("usre_name","$user");
	setcookie("usre_pass",$userpass);
	msg($wtime,"admin.php","登陆成功，系统将自动跳转到后台界面！");
	exit;
}else
{
	msg($wtime,"login.php","登陆失败，系统将返回登陆界面！");
	exit;
}
?>