<?php
	if (Tourists()){ header('refresh:0;url=./index.php?act=my'); exit; }
		if (!empty ($_POST['user']) and !empty ($_POST['pass'])){
			$sql = mysql_fetch_array (mysql_query ("SELECT * FROM `user` WHERE `user`='{$_POST['user']}'"));
			if ($_POST['pass'] != $sql['pass']){
				$info = '登陆失败！<meta http-equiv="refresh" content="3;url=index.php?act=login">';
			}else{
				if ($_POST['cookieType'] == 3){
					$cookietime = 1800;
				}else if($_POST['cookieType'] == 1){
					$cookietime = 259200;
				}else{
					$cookietime = 2592000;
				}

				setcookie('AnYue_User',$_POST['user'],time() + $cookietime);
				setcookie('AnYue_Pass',$AnYue_Abm -> Job ($_POST['pass'],$websitekey),time() + $cookietime);
				mysql_query("UPDATE `user` SET `outip`='{$sql['loginip']}' WHERE `user`='{$_POST['user']}'");
				mysql_query("UPDATE `user` SET `loginip`='".ip ()."' WHERE `user`='{$_POST['user']}'");
				$info = '登陆成功！<meta http-equiv="refresh" content="3;url=index.php?act=my">';
			}
		}else{
			$info = '用户名或密码不能为空！<meta http-equiv="refresh" content="3;url=index.php?act=login">';
		}

		$AnYue_Smarty -> assign ('info',$info);
		$AnYue_Smarty -> display ('polog.html');
